Advanced React Pattern
// Wrong this.setState({ counter: this.state.counter + this.props.increment, });
// Correct this.setState((state, props) => ({ counter: state.counter + props.increment }));
This.props and this.state might not be updated asynchronously
By Stanney Yen