贪心 CVTranformer研修
function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) { // ??? checkShouldComponentUpdate 什么时候调用
const instance = workInProgress.stateNode;
if(typeof instance.shouldComponentUpdate === 'function') {
const shouldUpdate = instance.shouldComponentUpdate(newProps, newState, newxtContext);
return shouldUpdate;
}
if(ctor.prototype && ctor.prototype.isPureReactComponent) {
return (!shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState)); x}