(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext)
| 12815 | }; |
| 12816 | |
| 12817 | function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) { |
| 12818 | var instance = workInProgress.stateNode; |
| 12819 | |
| 12820 | if (typeof instance.shouldComponentUpdate === 'function') { |
| 12821 | { |
| 12822 | if ( workInProgress.mode & StrictMode) { |
| 12823 | // Invoke the function an extra time to help detect side-effects. |
| 12824 | instance.shouldComponentUpdate(newProps, newState, nextContext); |
| 12825 | } |
| 12826 | } |
| 12827 | |
| 12828 | startPhaseTimer(workInProgress, 'shouldComponentUpdate'); |
| 12829 | var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext); |
| 12830 | stopPhaseTimer(); |
| 12831 | |
| 12832 | { |
| 12833 | if (shouldUpdate === undefined) { |
| 12834 | error('%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component'); |
| 12835 | } |
| 12836 | } |
| 12837 | |
| 12838 | return shouldUpdate; |
| 12839 | } |
| 12840 | |
| 12841 | if (ctor.prototype && ctor.prototype.isPureReactComponent) { |
| 12842 | return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); |
| 12843 | } |
| 12844 | |
| 12845 | return true; |
| 12846 | } |
| 12847 | |
| 12848 | function checkClassInstance(workInProgress, ctor, newProps) { |
| 12849 | var instance = workInProgress.stateNode; |
no test coverage detected