(workInProgress, oldProps, newProps, oldState, newState, newContext)
| 8521 | }; |
| 8522 | |
| 8523 | function checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext) { |
| 8524 | if (oldProps === null || workInProgress.updateQueue !== null && workInProgress.updateQueue.hasForceUpdate) { |
| 8525 | // If the workInProgress already has an Update effect, return true |
| 8526 | return true; |
| 8527 | } |
| 8528 | |
| 8529 | var instance = workInProgress.stateNode; |
| 8530 | var ctor = workInProgress.type; |
| 8531 | if (typeof instance.shouldComponentUpdate === 'function') { |
| 8532 | startPhaseTimer(workInProgress, 'shouldComponentUpdate'); |
| 8533 | var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, newContext); |
| 8534 | stopPhaseTimer(); |
| 8535 | |
| 8536 | { |
| 8537 | warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(workInProgress) || 'Component'); |
| 8538 | } |
| 8539 | |
| 8540 | return shouldUpdate; |
| 8541 | } |
| 8542 | |
| 8543 | if (ctor.prototype && ctor.prototype.isPureReactComponent) { |
| 8544 | return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); |
| 8545 | } |
| 8546 | |
| 8547 | return true; |
| 8548 | } |
| 8549 | |
| 8550 | function checkClassInstance(workInProgress) { |
| 8551 | var instance = workInProgress.stateNode; |
no test coverage detected