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

Function mountClassInstance

code/dependency-injection/public/app.js:8608–8649  ·  view source on GitHub ↗
(workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

8606
8607 // Invokes the mount life-cycles on a previously never rendered instance.
8608 function mountClassInstance(workInProgress, renderExpirationTime) {
8609 var ctor = workInProgress.type;
8610 var current = workInProgress.alternate;
8611
8612 {
8613 checkClassInstance(workInProgress);
8614 }
8615
8616 var instance = workInProgress.stateNode;
8617 var props = workInProgress.pendingProps;
8618 var unmaskedContext = getUnmaskedContext(workInProgress);
8619
8620 instance.props = props;
8621 instance.state = workInProgress.memoizedState;
8622 instance.refs = emptyObject;
8623 instance.context = getMaskedContext(workInProgress, unmaskedContext);
8624
8625 {
8626 if (workInProgress.mode & StrictMode) {
8627 ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);
8628 }
8629
8630 if (warnAboutDeprecatedLifecycles) {
8631 ReactStrictModeWarnings.recordDeprecationWarnings(workInProgress, instance);
8632 }
8633 }
8634
8635 // In order to support react-lifecycles-compat polyfilled components,
8636 // Unsafe lifecycles should not be invoked for any component with the new gDSFP.
8637 if ((typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function') && typeof ctor.getDerivedStateFromProps !== 'function') {
8638 callComponentWillMount(workInProgress, instance);
8639 // If we had additional state updates during this life-cycle, let's
8640 // process them now.
8641 var updateQueue = workInProgress.updateQueue;
8642 if (updateQueue !== null) {
8643 instance.state = processUpdateQueue(current, workInProgress, updateQueue, instance, props, renderExpirationTime);
8644 }
8645 }
8646 if (typeof instance.componentDidMount === 'function') {
8647 workInProgress.effectTag |= Update;
8648 }
8649 }
8650
8651 function resumeMountClassInstance(workInProgress, renderExpirationTime) {
8652 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