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

Function callComponentWillMount

code/third-party/public/app.js:7677–7696  ·  view source on GitHub ↗
(workInProgress, instance)

Source from the content-addressed store, hash-verified

7675 }
7676
7677 function callComponentWillMount(workInProgress, instance) {
7678 startPhaseTimer(workInProgress, 'componentWillMount');
7679 var oldState = instance.state;
7680
7681 if (typeof instance.componentWillMount === 'function') {
7682 instance.componentWillMount();
7683 }
7684 if (typeof instance.UNSAFE_componentWillMount === 'function') {
7685 instance.UNSAFE_componentWillMount();
7686 }
7687
7688 stopPhaseTimer();
7689
7690 if (oldState !== instance.state) {
7691 {
7692 warning(false, '%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress) || 'Component');
7693 }
7694 updater.enqueueReplaceState(instance, instance.state, null);
7695 }
7696 }
7697
7698 function callComponentWillReceiveProps(workInProgress, instance, newProps, newContext) {
7699 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