MCPcopy Create free account
hub / github.com/reactjs/react-rails / callComponentWillMount

Function callComponentWillMount

lib/assets/react-source/development/react.js:16639–16660  ·  view source on GitHub ↗
(workInProgress, instance)

Source from the content-addressed store, hash-verified

16637 }
16638
16639 function callComponentWillMount(workInProgress, instance) {
16640 startPhaseTimer(workInProgress, 'componentWillMount');
16641 var oldState = instance.state;
16642
16643 if (typeof instance.componentWillMount === 'function') {
16644 instance.componentWillMount();
16645 }
16646
16647 if (typeof instance.UNSAFE_componentWillMount === 'function') {
16648 instance.UNSAFE_componentWillMount();
16649 }
16650
16651 stopPhaseTimer();
16652
16653 if (oldState !== instance.state) {
16654 {
16655 error('%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component');
16656 }
16657
16658 classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
16659 }
16660 }
16661
16662 function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) {
16663 var oldState = instance.state;

Callers 1

mountClassInstanceFunction · 0.85

Calls 4

startPhaseTimerFunction · 0.85
stopPhaseTimerFunction · 0.85
errorFunction · 0.70
getComponentNameFunction · 0.70

Tested by

no test coverage detected