Closed ntgussoni closed 3 years ago
I was testing this babel plugin in one of our projects with blitz.js and noticed that whenever the WithSuperJSON HOC was used, the getLayout method was lost (as well as other static methods).
The fix is pretty simple and referenced here https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over
This PR adds hoistNonReactStatics as recommended and a test in the examples folder.
hoistNonReactStatics
Love it! Thanks for this well-made PR ☺️
@allcontributors add ntgussoni code test bug
@Skn0tt
I've put up a pull request to add @ntgussoni! :tada:
I was testing this babel plugin in one of our projects with blitz.js and noticed that whenever the WithSuperJSON HOC was used, the getLayout method was lost (as well as other static methods).
The fix is pretty simple and referenced here https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over
This PR adds
hoistNonReactStatics
as recommended and a test in the examples folder.