Synvox/rehook

Non-function React component as the last parameter of pipe() or renderComponent()

Opened this issue · 2 comments

The "Smart/Presentational Components" section of readme says that pipe(withProps({}), Component) is a supported use case.

The implementation of pipe() is concise and elegant. Unfortunately it doesn’t work when the supplied Component was created by e.g. React.forwardRef() and thus is not a function but an object.

Could you add support for such components as well?

Actually the defaultProps are also lost when used this way.

Apparently renderComponent() also assumes that component is a function