Last active
May 7, 2019 14:21
-
-
Save mohandere/680a06f0981fb8b965db71cdf5c36ae0 to your computer and use it in GitHub Desktop.
Higher Order Components
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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