(workInProgress, oldProps, newProps, oldState, newState, newContext)
| 8305 | }; |
| 8306 | |
| 8307 | function checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext) { |
| 8308 | if (oldProps === null || workInProgress.updateQueue !== null && workInProgress.updateQueue.hasForceUpdate) { |
| 8309 | // If the workInProgress already has an Update effect, return true |
| 8310 | return true; |
| 8311 | } |
| 8312 | |
| 8313 | var instance = workInProgress.stateNode; |
| 8314 | var ctor = workInProgress.type; |
| 8315 | if (typeof instance.shouldComponentUpdate === 'function') { |
| 8316 | startPhaseTimer(workInProgress, 'shouldComponentUpdate'); |
| 8317 | var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, newContext); |
| 8318 | stopPhaseTimer(); |
| 8319 | |
| 8320 | { |
| 8321 | warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(workInProgress) || 'Component'); |
| 8322 | } |
| 8323 | |
| 8324 | return shouldUpdate; |
| 8325 | } |
| 8326 | |
| 8327 | if (ctor.prototype && ctor.prototype.isPureReactComponent) { |
| 8328 | return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); |
| 8329 | } |
| 8330 | |
| 8331 | return true; |
| 8332 | } |
| 8333 | |
| 8334 | function checkClassInstance(workInProgress) { |
| 8335 | var instance = workInProgress.stateNode; |
no test coverage detected