Skip to main content

7.14 Using shouldComponentUpdate For Optimization

Persons.js
  shouldComponentUpdate(nextProps, nextState) {
console.log("[Persons.js] shouldComponentUpdate");
if (nextProps.persons === this.props.persons) {
return false;
} else {
return true;
}
}