Skip to content

Static properties should be copied over #31

Open
@such

Description

@such

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!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions