Skip to content

Instantly share code, notes, and snippets.

@SirSerje
Last active February 11, 2020 10:45
Show Gist options
  • Save SirSerje/5a7529b6e605aabb102531f01ea1317d to your computer and use it in GitHub Desktop.
Save SirSerje/5a7529b6e605aabb102531f01ea1317d to your computer and use it in GitHub Desktop.
Any HOC tweaks
const AddWelcome = (GreetingComponent) => {
class TheNewComponent extends Component {
render() {
return (
<div>
<GreetingComponent {…this.props}/>
<p>Welcome to React!</p>
</div>);
}
}
return TheNewComponent;
};
//HOC for stateless
const statelessHOC = Component => props => <Component {...props} />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment