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

Function callComponentWillReceiveProps

code/composition/public/app.js:8603–8624  ·  view source on GitHub ↗
(workInProgress, instance, newProps, newContext)

Source from the content-addressed store, hash-verified

8601 }
8602
8603 function callComponentWillReceiveProps(workInProgress, instance, newProps, newContext) {
8604 var oldState = instance.state;
8605 startPhaseTimer(workInProgress, 'componentWillReceiveProps');
8606 if (typeof instance.componentWillReceiveProps === 'function') {
8607 instance.componentWillReceiveProps(newProps, newContext);
8608 }
8609 if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
8610 instance.UNSAFE_componentWillReceiveProps(newProps, newContext);
8611 }
8612 stopPhaseTimer();
8613
8614 if (instance.state !== oldState) {
8615 {
8616 var componentName = getComponentName(workInProgress) || 'Component';
8617 if (!didWarnAboutStateAssignmentForComponent[componentName]) {
8618 warning(false, '%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName);
8619 didWarnAboutStateAssignmentForComponent[componentName] = true;
8620 }
8621 }
8622 updater.enqueueReplaceState(instance, instance.state, null);
8623 }
8624 }
8625
8626 function callGetDerivedStateFromProps(workInProgress, instance, nextProps, prevState) {
8627 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