(workInProgress, oldProps, newProps, oldState, newState, newContext)
| 7631 | }; |
| 7632 | |
| 7633 | function checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext) { |
| 7634 | if (oldProps === null || workInProgress.updateQueue !== null && workInProgress.updateQueue.hasForceUpdate) { |
| 7635 | // If the workInProgress already has an Update effect, return true |
| 7636 | return true; |
| 7637 | } |
| 7638 | |
| 7639 | var instance = workInProgress.stateNode; |
| 7640 | var ctor = workInProgress.type; |
| 7641 | if (typeof instance.shouldComponentUpdate === 'function') { |
| 7642 | startPhaseTimer(workInProgress, 'shouldComponentUpdate'); |
| 7643 | var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, newContext); |
| 7644 | stopPhaseTimer(); |
| 7645 | |
| 7646 | { |
| 7647 | warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(workInProgress) || 'Component'); |
| 7648 | } |
| 7649 | |
| 7650 | return shouldUpdate; |
| 7651 | } |
| 7652 | |
| 7653 | if (ctor.prototype && ctor.prototype.isPureReactComponent) { |
| 7654 | return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); |
| 7655 | } |
| 7656 | |
| 7657 | return true; |
| 7658 | } |
| 7659 | |
| 7660 | function checkClassInstance(workInProgress) { |
| 7661 | var instance = workInProgress.stateNode; |
no test coverage detected