貪心 CVTranformer研修
function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) { // ??? checkShouldComponentUpdate 什么時(shí)候調(diào)用
?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}
標(biāo)簽: