Re:React in Patterns
by jshc on Monday May 14, 2018 @12:22AM
(#17062657)
curious about the explicit true and false in one of their code examples. any good reason for that?
// dispatching an action based on state change
componentWillUpdate(nextProps, nextState) {
if (nextState.open == true && this.state.open == false) {
this.props.onWillOpen();
}
}
// dispatching an action based on state change componentWillUpdate(nextProps, nextState) { if (nextState.open == true && this.state.open == false) { this.props.onWillOpen(); } }