(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext)
| 17996 | }; |
| 17997 | |
| 17998 | function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) { |
| 17999 | var instance = workInProgress.stateNode; |
| 18000 | |
| 18001 | if (typeof instance.shouldComponentUpdate === 'function') { |
| 18002 | var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext); |
| 18003 | |
| 18004 | { |
| 18005 | if ( workInProgress.mode & StrictLegacyMode) { |
| 18006 | setIsStrictModeForDevtools(true); |
| 18007 | |
| 18008 | try { |
| 18009 | // Invoke the function an extra time to help detect side-effects. |
| 18010 | shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext); |
| 18011 | } finally { |
| 18012 | setIsStrictModeForDevtools(false); |
| 18013 | } |
| 18014 | } |
| 18015 | |
| 18016 | if (shouldUpdate === undefined) { |
| 18017 | error('%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentNameFromType(ctor) || 'Component'); |
| 18018 | } |
| 18019 | } |
| 18020 | |
| 18021 | return shouldUpdate; |
| 18022 | } |
| 18023 | |
| 18024 | if (ctor.prototype && ctor.prototype.isPureReactComponent) { |
| 18025 | return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); |
| 18026 | } |
| 18027 | |
| 18028 | return true; |
| 18029 | } |
| 18030 | |
| 18031 | function checkClassInstance(workInProgress, ctor, newProps) { |
| 18032 | var instance = workInProgress.stateNode; |
no test coverage detected
searching dependent graphs…