(workInProgress, renderExpirationTime)
| 7746 | |
| 7747 | // Invokes the mount life-cycles on a previously never rendered instance. |
| 7748 | function mountClassInstance(workInProgress, renderExpirationTime) { |
| 7749 | var ctor = workInProgress.type; |
| 7750 | var current = workInProgress.alternate; |
| 7751 | |
| 7752 | { |
| 7753 | checkClassInstance(workInProgress); |
| 7754 | } |
| 7755 | |
| 7756 | var instance = workInProgress.stateNode; |
| 7757 | var props = workInProgress.pendingProps; |
| 7758 | var unmaskedContext = getUnmaskedContext(workInProgress); |
| 7759 | |
| 7760 | instance.props = props; |
| 7761 | instance.state = workInProgress.memoizedState; |
| 7762 | instance.refs = emptyObject; |
| 7763 | instance.context = getMaskedContext(workInProgress, unmaskedContext); |
| 7764 | |
| 7765 | { |
| 7766 | if (workInProgress.mode & StrictMode) { |
| 7767 | ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance); |
| 7768 | } |
| 7769 | |
| 7770 | if (warnAboutDeprecatedLifecycles) { |
| 7771 | ReactStrictModeWarnings.recordDeprecationWarnings(workInProgress, instance); |
| 7772 | } |
| 7773 | } |
| 7774 | |
| 7775 | // In order to support react-lifecycles-compat polyfilled components, |
| 7776 | // Unsafe lifecycles should not be invoked for any component with the new gDSFP. |
| 7777 | if ((typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function') && typeof ctor.getDerivedStateFromProps !== 'function') { |
| 7778 | callComponentWillMount(workInProgress, instance); |
| 7779 | // If we had additional state updates during this life-cycle, let's |
| 7780 | // process them now. |
| 7781 | var updateQueue = workInProgress.updateQueue; |
| 7782 | if (updateQueue !== null) { |
| 7783 | instance.state = processUpdateQueue(current, workInProgress, updateQueue, instance, props, renderExpirationTime); |
| 7784 | } |
| 7785 | } |
| 7786 | if (typeof instance.componentDidMount === 'function') { |
| 7787 | workInProgress.effectTag |= Update; |
| 7788 | } |
| 7789 | } |
| 7790 | |
| 7791 | function resumeMountClassInstance(workInProgress, renderExpirationTime) { |
| 7792 | var ctor = workInProgress.type; |
no test coverage detected