Skip to content

Instantly share code, notes, and snippets.

@tpetrina
Last active September 26, 2017 15:01
Show Gist options
  • Save tpetrina/7b1c3e6b8b92612984f24edb0c0db72d to your computer and use it in GitHub Desktop.
Save tpetrina/7b1c3e6b8b92612984f24edb0c0db72d to your computer and use it in GitHub Desktop.
React form complication 8
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