Answer the question
In order to leave comments, you need to log in
How to implement via HOC, react?
Good afternoon! Can you please tell me how to implement this component through HOC?
const SortableItem = SortableElement(({value}) => (
<ElementItem value={value}/>
));
export default hocComponent(ElementItem)
Answer the question
In order to leave comments, you need to log in
Without options:
const withSort = WrappedComponent => props => {
return WrappedComponent ? <WrappedComponent {...props} /> : null;
});
const withSort = (...params) => WrappedComponent => props => {
// params usage
return WrappedComponent ? <WrappedComponent {...props} /> : null;
});
export default withSort(param1, param2)(Component);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question