xxxxxxxxxx
A higher-order component is a function that takes a component and returns a new component. A higher-order component (HOC) is the advanced technique in React. js for reusing a component logic. Higher-Order Components are not part of the React API. They are the pattern that emerges from React's compositional nature.
xxxxxxxxxx
A higher-order component (HoC) is a function that takes
a component and returns a new component.
const EnhancedComponent = higherOrderComponent(WrappedComponent);
hoc component fully custom react
xxxxxxxxxx
const showModalScrollable = (component, props) => {
Navigation.showModal({
component: {
name: COMPONENT_NAMES.modalScrollable,
passProps: {
renderContent: (componentId) => {
const allProps = { componentId, props };
return React.createElement(component, allProps);
},
},
},