Skip to content

Instantly share code, notes, and snippets.

@mohandere
Last active May 7, 2019 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohandere/680a06f0981fb8b965db71cdf5c36ae0 to your computer and use it in GitHub Desktop.
Save mohandere/680a06f0981fb8b965db71cdf5c36ae0 to your computer and use it in GitHub Desktop.
Higher Order Components
const propsProxyHOC = (WraapperComponent) => {
return class extends React.Component {
state = {
count: 0
}
render() {
// Pass thru the props that the HOC receives
return <WraapperComponent {...this.props} {...this.state} />
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment