(workInProgress, oldProps, newProps, oldState, newState, newContext)
| 8270 | }; |
| 8271 | |
| 8272 | function checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext) { |
| 8273 | if (oldProps === null || workInProgress.updateQueue !== null && workInProgress.updateQueue.hasForceUpdate) { |
| 8274 | // If the workInProgress already has an Update effect, return true |
| 8275 | return true; |
| 8276 | } |
| 8277 | |
| 8278 | var instance = workInProgress.stateNode; |
| 8279 | var ctor = workInProgress.type; |
| 8280 | if (typeof instance.shouldComponentUpdate === 'function') { |
| 8281 | startPhaseTimer(workInProgress, 'shouldComponentUpdate'); |
| 8282 | var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, newContext); |
| 8283 | stopPhaseTimer(); |
| 8284 | |
| 8285 | { |
| 8286 | warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(workInProgress) || 'Component'); |
| 8287 | } |
| 8288 | |
| 8289 | return shouldUpdate; |
| 8290 | } |
| 8291 | |
| 8292 | if (ctor.prototype && ctor.prototype.isPureReactComponent) { |
| 8293 | return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); |
| 8294 | } |
| 8295 | |
| 8296 | return true; |
| 8297 | } |
| 8298 | |
| 8299 | function checkClassInstance(workInProgress) { |
| 8300 | var instance = workInProgress.stateNode; |
no test coverage detected