MCPcopy
hub / github.com/tastejs/todomvc / checkShouldComponentUpdate

Function checkShouldComponentUpdate

examples/typescript-react/js/bundle.js:13317–13336  ·  view source on GitHub ↗
(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext)

Source from the content-addressed store, hash-verified

13315};
13316
13317function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) {
13318 var instance = workInProgress.stateNode;
13319 if (typeof instance.shouldComponentUpdate === 'function') {
13320 startPhaseTimer(workInProgress, 'shouldComponentUpdate');
13321 var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
13322 stopPhaseTimer();
13323
13324 {
13325 !(shouldUpdate !== undefined) ? warningWithoutStack$1(false, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component') : void 0;
13326 }
13327
13328 return shouldUpdate;
13329 }
13330
13331 if (ctor.prototype && ctor.prototype.isPureReactComponent) {
13332 return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
13333 }
13334
13335 return true;
13336}
13337
13338function checkClassInstance(workInProgress, ctor, newProps) {
13339 var instance = workInProgress.stateNode;

Callers 2

resumeMountClassInstanceFunction · 0.85
updateClassInstanceFunction · 0.85

Calls 5

startPhaseTimerFunction · 0.85
stopPhaseTimerFunction · 0.85
getComponentNameFunction · 0.85
shouldComponentUpdateMethod · 0.80
shallowEqualFunction · 0.70

Tested by

no test coverage detected