(current, workInProgress, renderExpirationTime)
| 10335 | } |
| 10336 | |
| 10337 | function mountIndeterminateComponent(current, workInProgress, renderExpirationTime) { |
| 10338 | !(current === null) ? invariant(false, 'An indeterminate component should never have mounted. This error is likely caused by a bug in React. Please file an issue.') : void 0; |
| 10339 | var fn = workInProgress.type; |
| 10340 | var props = workInProgress.pendingProps; |
| 10341 | var unmaskedContext = getUnmaskedContext(workInProgress); |
| 10342 | var context = getMaskedContext(workInProgress, unmaskedContext); |
| 10343 | |
| 10344 | var value = void 0; |
| 10345 | |
| 10346 | { |
| 10347 | if (fn.prototype && typeof fn.prototype.render === 'function') { |
| 10348 | var componentName = getComponentName(workInProgress) || 'Unknown'; |
| 10349 | |
| 10350 | if (!didWarnAboutBadClass[componentName]) { |
| 10351 | warning(false, "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName); |
| 10352 | didWarnAboutBadClass[componentName] = true; |
| 10353 | } |
| 10354 | } |
| 10355 | ReactCurrentOwner.current = workInProgress; |
| 10356 | value = fn(props, context); |
| 10357 | } |
| 10358 | // React DevTools reads this flag. |
| 10359 | workInProgress.effectTag |= PerformedWork; |
| 10360 | |
| 10361 | if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) { |
| 10362 | var Component = workInProgress.type; |
| 10363 | |
| 10364 | // Proceed under the assumption that this is a class instance |
| 10365 | workInProgress.tag = ClassComponent; |
| 10366 | |
| 10367 | workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null; |
| 10368 | |
| 10369 | if (typeof Component.getDerivedStateFromProps === 'function') { |
| 10370 | var partialState = callGetDerivedStateFromProps(workInProgress, value, props, workInProgress.memoizedState); |
| 10371 | |
| 10372 | if (partialState !== null && partialState !== undefined) { |
| 10373 | workInProgress.memoizedState = _assign({}, workInProgress.memoizedState, partialState); |
| 10374 | } |
| 10375 | } |
| 10376 | |
| 10377 | // Push context providers early to prevent context stack mismatches. |
| 10378 | // During mounting we don't know the child context yet as the instance doesn't exist. |
| 10379 | // We will invalidate the child context in finishClassComponent() right after rendering. |
| 10380 | var hasContext = pushLegacyContextProvider(workInProgress); |
| 10381 | adoptClassInstance(workInProgress, value); |
| 10382 | mountClassInstance(workInProgress, renderExpirationTime); |
| 10383 | return finishClassComponent(current, workInProgress, true, hasContext, false, renderExpirationTime); |
| 10384 | } else { |
| 10385 | // Proceed under the assumption that this is a functional component |
| 10386 | workInProgress.tag = FunctionalComponent; |
| 10387 | { |
| 10388 | var _Component = workInProgress.type; |
| 10389 | |
| 10390 | if (_Component) { |
| 10391 | warning(!_Component.childContextTypes, '%s(...): childContextTypes cannot be defined on a functional component.', _Component.displayName || _Component.name || 'Component'); |
| 10392 | } |
| 10393 | if (workInProgress.ref !== null) { |
| 10394 | var info = ''; |
no test coverage detected