ES6 Classes & Constructors
What common JavaScript library or framework pattern does this class resemble?
class Component {
constructor(props) {
this.props = props;
this.state = {};
}
setState(newState) {
this.state = {...this.state, ...newState};
this.render();
}
render() {
throw new Error('You must implement render()');
}
}