Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static properties should be copied over #31

Open
such opened this issue Jul 17, 2018 · 0 comments
Open

Static properties should be copied over #31

such opened this issue Jul 17, 2018 · 0 comments

Comments

@such
Copy link

such commented Jul 17, 2018

Hey,

Thanks a lot for this library!
It appears that you do not copy static methods as described here: https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over
It seems the convention is that all HOC should do that. The behaviour is somewhat unexpected otherwise.
Are you planning on adding it to the library?

In the meantime, I'm using this workaround:

const WithHoc = compose(
  withRouter,
  withSizes(mapSizesToProps),
  withStyles(styles)
)(WrappedComponent);

hoistNonReactStatic(WithHoc, WrappedComponent);

export default WithHoc;

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants