react shouldcomplnentupdate code example
Example 1: shouldcomponentupdate
shouldComponentUpdate(nextProps, nextState) {
return true;
}
Example 2: shouldcomponentupdate default return
By default, shouldComponentUpdate returns true, but you can override it to return false for cases that you do not want a re-render.