MCPcopy Create free account
hub / github.com/microsoft/SandDance / callComponentWillMount

Function callComponentWillMount

docs/external/js/react-dom.development.js:13079–13100  ·  view source on GitHub ↗
(workInProgress, instance)

Source from the content-addressed store, hash-verified

13077 }
13078
13079 function callComponentWillMount(workInProgress, instance) {
13080 startPhaseTimer(workInProgress, 'componentWillMount');
13081 var oldState = instance.state;
13082
13083 if (typeof instance.componentWillMount === 'function') {
13084 instance.componentWillMount();
13085 }
13086
13087 if (typeof instance.UNSAFE_componentWillMount === 'function') {
13088 instance.UNSAFE_componentWillMount();
13089 }
13090
13091 stopPhaseTimer();
13092
13093 if (oldState !== instance.state) {
13094 {
13095 error('%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component');
13096 }
13097
13098 classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
13099 }
13100 }
13101
13102 function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) {
13103 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