(workInProgress, oldProps, newProps, oldState, newState, newContext)
| 7600 | }; |
| 7601 | |
| 7602 | function checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext) { |
| 7603 | if (oldProps === null || workInProgress.updateQueue !== null && workInProgress.updateQueue.hasForceUpdate) { |
| 7604 | // If the workInProgress already has an Update effect, return true |
| 7605 | return true; |
| 7606 | } |
| 7607 | |
| 7608 | var instance = workInProgress.stateNode; |
| 7609 | var ctor = workInProgress.type; |
| 7610 | if (typeof instance.shouldComponentUpdate === 'function') { |
| 7611 | startPhaseTimer(workInProgress, 'shouldComponentUpdate'); |
| 7612 | var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, newContext); |
| 7613 | stopPhaseTimer(); |
| 7614 | |
| 7615 | { |
| 7616 | warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(workInProgress) || 'Component'); |
| 7617 | } |
| 7618 | |
| 7619 | return shouldUpdate; |
| 7620 | } |
| 7621 | |
| 7622 | if (ctor.prototype && ctor.prototype.isPureReactComponent) { |
| 7623 | return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); |
| 7624 | } |
| 7625 | |
| 7626 | return true; |
| 7627 | } |
| 7628 | |
| 7629 | function checkClassInstance(workInProgress) { |
| 7630 | var instance = workInProgress.stateNode; |
no test coverage detected