Last active
September 26, 2017 15:01
-
-
Save tpetrina/7b1c3e6b8b92612984f24edb0c0db72d to your computer and use it in GitHub Desktop.
React form complication 8
This file contains 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 hoc = Wrapped => | |
class extends React.Component { | |
render() { | |
// pass props from parent to the wrapped component | |
return <Wrapped {...this.props} /> | |
} | |
} | |
// usage: | |
const WrappedComponent = hoc(SomeComponent) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment