Skip to content

Instantly share code, notes, and snippets.

@jeromepl
jeromepl / Enhance.js
Last active Apr 6, 2020 — forked from sebmarkbage/Enhance.js
Higher-order Components in React with ES7
View Enhance.js
import { Component } from "React";
export default (ComposedComponent) => class extends Component {
constructor(props) {
super(props);
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}