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

Function mountClassInstance

code/composition/public/app.js:8653–8694  ·  view source on GitHub ↗
(workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

8651
8652 // Invokes the mount life-cycles on a previously never rendered instance.
8653 function mountClassInstance(workInProgress, renderExpirationTime) {
8654 var ctor = workInProgress.type;
8655 var current = workInProgress.alternate;
8656
8657 {
8658 checkClassInstance(workInProgress);
8659 }
8660
8661 var instance = workInProgress.stateNode;
8662 var props = workInProgress.pendingProps;
8663 var unmaskedContext = getUnmaskedContext(workInProgress);
8664
8665 instance.props = props;
8666 instance.state = workInProgress.memoizedState;
8667 instance.refs = emptyObject;
8668 instance.context = getMaskedContext(workInProgress, unmaskedContext);
8669
8670 {
8671 if (workInProgress.mode & StrictMode) {
8672 ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);
8673 }
8674
8675 if (warnAboutDeprecatedLifecycles) {
8676 ReactStrictModeWarnings.recordDeprecationWarnings(workInProgress, instance);
8677 }
8678 }
8679
8680 // In order to support react-lifecycles-compat polyfilled components,
8681 // Unsafe lifecycles should not be invoked for any component with the new gDSFP.
8682 if ((typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function') && typeof ctor.getDerivedStateFromProps !== 'function') {
8683 callComponentWillMount(workInProgress, instance);
8684 // If we had additional state updates during this life-cycle, let's
8685 // process them now.
8686 var updateQueue = workInProgress.updateQueue;
8687 if (updateQueue !== null) {
8688 instance.state = processUpdateQueue(current, workInProgress, updateQueue, instance, props, renderExpirationTime);
8689 }
8690 }
8691 if (typeof instance.componentDidMount === 'function') {
8692 workInProgress.effectTag |= Update;
8693 }
8694 }
8695
8696 function resumeMountClassInstance(workInProgress, renderExpirationTime) {
8697 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