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

Function mountClassInstance

code/new-context-api/public/app.js:7876–7917  ·  view source on GitHub ↗
(workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

7874
7875 // Invokes the mount life-cycles on a previously never rendered instance.
7876 function mountClassInstance(workInProgress, renderExpirationTime) {
7877 var ctor = workInProgress.type;
7878 var current = workInProgress.alternate;
7879
7880 {
7881 checkClassInstance(workInProgress);
7882 }
7883
7884 var instance = workInProgress.stateNode;
7885 var props = workInProgress.pendingProps;
7886 var unmaskedContext = getUnmaskedContext(workInProgress);
7887
7888 instance.props = props;
7889 instance.state = workInProgress.memoizedState;
7890 instance.refs = emptyObject;
7891 instance.context = getMaskedContext(workInProgress, unmaskedContext);
7892
7893 {
7894 if (workInProgress.mode & StrictMode) {
7895 ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);
7896 }
7897
7898 if (warnAboutDeprecatedLifecycles) {
7899 ReactStrictModeWarnings.recordDeprecationWarnings(workInProgress, instance);
7900 }
7901 }
7902
7903 // In order to support react-lifecycles-compat polyfilled components,
7904 // Unsafe lifecycles should not be invoked for any component with the new gDSFP.
7905 if ((typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function') && typeof ctor.getDerivedStateFromProps !== 'function') {
7906 callComponentWillMount(workInProgress, instance);
7907 // If we had additional state updates during this life-cycle, let's
7908 // process them now.
7909 var updateQueue = workInProgress.updateQueue;
7910 if (updateQueue !== null) {
7911 instance.state = processUpdateQueue(current, workInProgress, updateQueue, instance, props, renderExpirationTime);
7912 }
7913 }
7914 if (typeof instance.componentDidMount === 'function') {
7915 workInProgress.effectTag |= Update;
7916 }
7917 }
7918
7919 function resumeMountClassInstance(workInProgress, renderExpirationTime) {
7920 var ctor = workInProgress.type;

Callers 2

updateClassComponentFunction · 0.70

Calls 5

checkClassInstanceFunction · 0.70
getUnmaskedContextFunction · 0.70
getMaskedContextFunction · 0.70
callComponentWillMountFunction · 0.70
processUpdateQueueFunction · 0.70

Tested by

no test coverage detected