MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / callComponentWillReceiveProps

Function callComponentWillReceiveProps

code/redux/public/app.js:8716–8737  ·  view source on GitHub ↗
(workInProgress, instance, newProps, newContext)

Source from the content-addressed store, hash-verified

8714 }
8715
8716 function callComponentWillReceiveProps(workInProgress, instance, newProps, newContext) {
8717 var oldState = instance.state;
8718 startPhaseTimer(workInProgress, 'componentWillReceiveProps');
8719 if (typeof instance.componentWillReceiveProps === 'function') {
8720 instance.componentWillReceiveProps(newProps, newContext);
8721 }
8722 if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
8723 instance.UNSAFE_componentWillReceiveProps(newProps, newContext);
8724 }
8725 stopPhaseTimer();
8726
8727 if (instance.state !== oldState) {
8728 {
8729 var componentName = getComponentName(workInProgress) || 'Component';
8730 if (!didWarnAboutStateAssignmentForComponent[componentName]) {
8731 warning(false, '%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName);
8732 didWarnAboutStateAssignmentForComponent[componentName] = true;
8733 }
8734 }
8735 updater.enqueueReplaceState(instance, instance.state, null);
8736 }
8737 }
8738
8739 function callGetDerivedStateFromProps(workInProgress, instance, nextProps, prevState) {
8740 var type = workInProgress.type;

Callers 2

resumeMountClassInstanceFunction · 0.70
updateClassInstanceFunction · 0.70

Calls 5

warningFunction · 0.85
startPhaseTimerFunction · 0.70
stopPhaseTimerFunction · 0.70
getComponentNameFunction · 0.70

Tested by

no test coverage detected