Answer the question
In order to leave comments, you need to log in
Classic currying, replace with {compose} function from Ramda.js to use ReactJS HOC?
The important point is that the function works from top to bottom, that is, from right to left, realizing this, I can’t use it instead of this entry:
export default HOC('props1')('props2')(ChildHoc)
Here is a complete example with all dependencies :
https://stackblitz.com/edit/hoccomponent?file=chil...
Answer the question
In order to leave comments, you need to log in
You apparently misunderstood something somewhere. Currying with compose cannot be replaced.
It is used to get rid of nesting:
// without compose
withLog(withRouter(connect(mapStateToProps)(withDropdown(props)(Component))));
// with compose
compose(
withLog,
withRouter,
connect(mapStateToProps),
withDropdown(props),
)(Component);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question