Skip to content

Instantly share code, notes, and snippets.

@sabesansathananthan
Created April 25, 2021 04:31
Show Gist options
  • Save sabesansathananthan/b6ebe91cf3c1008edbcf68a560f5ac4c to your computer and use it in GitHub Desktop.
Save sabesansathananthan/b6ebe91cf3c1008edbcf68a560f5ac4c to your computer and use it in GitHub Desktop.
How React Components Are Reused
const HOCFactoryFactory = (params) => {
// Operation params here
return (WrappedComponent) => {
return class EnhancedComponent extends WrappedComponent {
render() {
return params.isRender && this.props.isRender && super.render();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment