rehook icon indicating copy to clipboard operation
rehook copied to clipboard

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

Open arty-name opened this issue 4 years ago • 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?

arty-name avatar Nov 06 '19 15:11 arty-name

Actually the defaultProps are also lost when used this way.

arty-name avatar Nov 06 '19 16:11 arty-name

Apparently renderComponent() also assumes that component is a function

arty-name avatar Nov 07 '19 13:11 arty-name