Skip to content

Instantly share code, notes, and snippets.

@johnloven
Created March 23, 2018 17:44
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 johnloven/77d7357e290b49dfe2c6f8d667f11f90 to your computer and use it in GitHub Desktop.
Save johnloven/77d7357e290b49dfe2c6f8d667f11f90 to your computer and use it in GitHub Desktop.
const injectFunc = WrappedComponent =>
class InjectFunc extends React.Component {
render() {
return <WrappedComponent func={this.log} {...this.props}/>;
}
log = () => console.log("This function is from the HOC!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment