Closed spacesuitdiver closed 3 years ago
Hi @spacesuitdiver,
Thank you for the suggestion. I'm adding it to our SDK backlog. Given that you've already got a patch, would you be willing to submit a pull request with the patched changes? That'll help speed up the time to release the change publicly.
Thanks, @bwoskow-ld
Filed internally as 107066.
Any update on this? We're experiencing a similar issue with not being able to use getInitialProps with the HOC.
No, we have no update at this time.
This is available in SDK version 2.23.0.
This provider HOC should hoist statics so users using something like
static getInitialProps() {}
can use the HOC properly.https://github.com/launchdarkly/react-client-sdk/blob/2f0fad5d9b2c2f8561aa7ccab74415bfb17b772e/src/withLDProvider.tsx#L25
Here's the patch I did in our project for now:
This is documented here for more information (should also consider using displayName): https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over