(workInProgress, renderExpirationTime)
| 8764 | |
| 8765 | // Invokes the mount life-cycles on a previously never rendered instance. |
| 8766 | function mountClassInstance(workInProgress, renderExpirationTime) { |
| 8767 | var ctor = workInProgress.type; |
| 8768 | var current = workInProgress.alternate; |
| 8769 | |
| 8770 | { |
| 8771 | checkClassInstance(workInProgress); |
| 8772 | } |
| 8773 | |
| 8774 | var instance = workInProgress.stateNode; |
| 8775 | var props = workInProgress.pendingProps; |
| 8776 | var unmaskedContext = getUnmaskedContext(workInProgress); |
| 8777 | |
| 8778 | instance.props = props; |
| 8779 | instance.state = workInProgress.memoizedState; |
| 8780 | instance.refs = emptyObject; |
| 8781 | instance.context = getMaskedContext(workInProgress, unmaskedContext); |
| 8782 | |
| 8783 | { |
| 8784 | if (workInProgress.mode & StrictMode) { |
| 8785 | ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance); |
| 8786 | } |
| 8787 | |
| 8788 | if (warnAboutDeprecatedLifecycles) { |
| 8789 | ReactStrictModeWarnings.recordDeprecationWarnings(workInProgress, instance); |
| 8790 | } |
| 8791 | } |
| 8792 | |
| 8793 | // In order to support react-lifecycles-compat polyfilled components, |
| 8794 | // Unsafe lifecycles should not be invoked for any component with the new gDSFP. |
| 8795 | if ((typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function') && typeof ctor.getDerivedStateFromProps !== 'function') { |
| 8796 | callComponentWillMount(workInProgress, instance); |
| 8797 | // If we had additional state updates during this life-cycle, let's |
| 8798 | // process them now. |
| 8799 | var updateQueue = workInProgress.updateQueue; |
| 8800 | if (updateQueue !== null) { |
| 8801 | instance.state = processUpdateQueue(current, workInProgress, updateQueue, instance, props, renderExpirationTime); |
| 8802 | } |
| 8803 | } |
| 8804 | if (typeof instance.componentDidMount === 'function') { |
| 8805 | workInProgress.effectTag |= Update; |
| 8806 | } |
| 8807 | } |
| 8808 | |
| 8809 | function resumeMountClassInstance(workInProgress, renderExpirationTime) { |
| 8810 | var ctor = workInProgress.type; |
no test coverage detected