(workInProgress, oldProps, newProps, oldState, newState, newContext)
| 8408 | }; |
| 8409 | |
| 8410 | function checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext) { |
| 8411 | if (oldProps === null || workInProgress.updateQueue !== null && workInProgress.updateQueue.hasForceUpdate) { |
| 8412 | // If the workInProgress already has an Update effect, return true |
| 8413 | return true; |
| 8414 | } |
| 8415 | |
| 8416 | var instance = workInProgress.stateNode; |
| 8417 | var ctor = workInProgress.type; |
| 8418 | if (typeof instance.shouldComponentUpdate === 'function') { |
| 8419 | startPhaseTimer(workInProgress, 'shouldComponentUpdate'); |
| 8420 | var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, newContext); |
| 8421 | stopPhaseTimer(); |
| 8422 | |
| 8423 | { |
| 8424 | warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(workInProgress) || 'Component'); |
| 8425 | } |
| 8426 | |
| 8427 | return shouldUpdate; |
| 8428 | } |
| 8429 | |
| 8430 | if (ctor.prototype && ctor.prototype.isPureReactComponent) { |
| 8431 | return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); |
| 8432 | } |
| 8433 | |
| 8434 | return true; |
| 8435 | } |
| 8436 | |
| 8437 | function checkClassInstance(workInProgress) { |
| 8438 | var instance = workInProgress.stateNode; |
no test coverage detected