launchdarkly / react-client-sdk

LaunchDarkly Client-side SDK for React.js
Other
85 stars 68 forks source link

HOC static hoisting #71

Closed NathanWaddell121107 closed 3 years ago

NathanWaddell121107 commented 3 years ago

Requirements

Related issues

resolves #68

Describe the solution you've provided

Based on the solution proposed here: https://github.com/launchdarkly/react-client-sdk/issues/68#issue-869219074 Allowing for the withLDProvider HOC to hoist statics

Additional context

This PR adds the dependency: hoist-non-react-statics and dev-dependency: @types/hoist-non-react-statics. React docs ref: https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over

bwoskow-ld commented 3 years ago

Thanks @NathanWaddell121107 for the contribution! We will merge this into a temporary contribution branch and add a test for it before releasing publicly.

robbienohra commented 3 years ago

@bwoskow-ld looking forward to this!

bwoskow-ld commented 3 years ago

I forgot to comment here upon releasing the changes, but this is available in SDK version 2.23.0.