November 2018
Beginner
502 pages
10h 22m
English
shouldComponentUpdate is invoked just before rendering happens. It returns a Boolean value that determines whether rendering should happen. It can be used to optimize performance, preventing unnecessary render cycles.
public shouldComponentUpdate(nextProps: {}, nextState: IState) { console.log("shouldComponentUpdate", nextProps, nextState); return true;}
If we look at the running app, we see that shouldComponentUpdate happens between getDerivedStateFromProps and getSnapshotBeforeUpdate, as we expect.
public shouldComponentUpdate(nextProps: {}, nextState: IState) { console.log("shouldComponentUpdate", ...Read now
Unlock full access