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

Function mountClassInstance

code/event-handlers/public/app.js:7845–7886  ·  view source on GitHub ↗
(workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

7843
7844 // Invokes the mount life-cycles on a previously never rendered instance.
7845 function mountClassInstance(workInProgress, renderExpirationTime) {
7846 var ctor = workInProgress.type;
7847 var current = workInProgress.alternate;
7848
7849 {
7850 checkClassInstance(workInProgress);
7851 }
7852
7853 var instance = workInProgress.stateNode;
7854 var props = workInProgress.pendingProps;
7855 var unmaskedContext = getUnmaskedContext(workInProgress);
7856
7857 instance.props = props;
7858 instance.state = workInProgress.memoizedState;
7859 instance.refs = emptyObject;
7860 instance.context = getMaskedContext(workInProgress, unmaskedContext);
7861
7862 {
7863 if (workInProgress.mode & StrictMode) {
7864 ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);
7865 }
7866
7867 if (warnAboutDeprecatedLifecycles) {
7868 ReactStrictModeWarnings.recordDeprecationWarnings(workInProgress, instance);
7869 }
7870 }
7871
7872 // In order to support react-lifecycles-compat polyfilled components,
7873 // Unsafe lifecycles should not be invoked for any component with the new gDSFP.
7874 if ((typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function') && typeof ctor.getDerivedStateFromProps !== 'function') {
7875 callComponentWillMount(workInProgress, instance);
7876 // If we had additional state updates during this life-cycle, let's
7877 // process them now.
7878 var updateQueue = workInProgress.updateQueue;
7879 if (updateQueue !== null) {
7880 instance.state = processUpdateQueue(current, workInProgress, updateQueue, instance, props, renderExpirationTime);
7881 }
7882 }
7883 if (typeof instance.componentDidMount === 'function') {
7884 workInProgress.effectTag |= Update;
7885 }
7886 }
7887
7888 function resumeMountClassInstance(workInProgress, renderExpirationTime) {
7889 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