(workInProgress, oldProps, newProps, oldState, newState, newContext)
| 7503 | }; |
| 7504 | |
| 7505 | function checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext) { |
| 7506 | if (oldProps === null || workInProgress.updateQueue !== null && workInProgress.updateQueue.hasForceUpdate) { |
| 7507 | // If the workInProgress already has an Update effect, return true |
| 7508 | return true; |
| 7509 | } |
| 7510 | |
| 7511 | var instance = workInProgress.stateNode; |
| 7512 | var ctor = workInProgress.type; |
| 7513 | if (typeof instance.shouldComponentUpdate === 'function') { |
| 7514 | startPhaseTimer(workInProgress, 'shouldComponentUpdate'); |
| 7515 | var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, newContext); |
| 7516 | stopPhaseTimer(); |
| 7517 | |
| 7518 | { |
| 7519 | warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(workInProgress) || 'Component'); |
| 7520 | } |
| 7521 | |
| 7522 | return shouldUpdate; |
| 7523 | } |
| 7524 | |
| 7525 | if (ctor.prototype && ctor.prototype.isPureReactComponent) { |
| 7526 | return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); |
| 7527 | } |
| 7528 | |
| 7529 | return true; |
| 7530 | } |
| 7531 | |
| 7532 | function checkClassInstance(workInProgress) { |
| 7533 | var instance = workInProgress.stateNode; |
no test coverage detected