MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / callComponentWillMount

Function callComponentWillMount

code/styling/public/app.js:8444–8463  ·  view source on GitHub ↗
(workInProgress, instance)

Source from the content-addressed store, hash-verified

8442 }
8443
8444 function callComponentWillMount(workInProgress, instance) {
8445 startPhaseTimer(workInProgress, 'componentWillMount');
8446 var oldState = instance.state;
8447
8448 if (typeof instance.componentWillMount === 'function') {
8449 instance.componentWillMount();
8450 }
8451 if (typeof instance.UNSAFE_componentWillMount === 'function') {
8452 instance.UNSAFE_componentWillMount();
8453 }
8454
8455 stopPhaseTimer();
8456
8457 if (oldState !== instance.state) {
8458 {
8459 warning(false, '%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress) || 'Component');
8460 }
8461 updater.enqueueReplaceState(instance, instance.state, null);
8462 }
8463 }
8464
8465 function callComponentWillReceiveProps(workInProgress, instance, newProps, newContext) {
8466 var oldState = instance.state;

Callers 1

mountClassInstanceFunction · 0.70

Calls 4

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

Tested by

no test coverage detected