(returnFiber, currentFirstChild, newChild, expirationTime)
| 9620 | // itself. They will be added to the side-effect list as we pass through the |
| 9621 | // children and the parent. |
| 9622 | function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) { |
| 9623 | // This function is not recursive. |
| 9624 | // If the top level item is an array, we treat it as a set of children, |
| 9625 | // not as a fragment. Nested arrays on the other hand will be treated as |
| 9626 | // fragment nodes. Recursion happens at the normal flow. |
| 9627 | |
| 9628 | // Handle top level unkeyed fragments as if they were arrays. |
| 9629 | // This leads to an ambiguity between <>{[...]}</> and <>...</>. |
| 9630 | // We treat the ambiguous cases above the same. |
| 9631 | if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) { |
| 9632 | newChild = newChild.props.children; |
| 9633 | } |
| 9634 | |
| 9635 | // Handle object types |
| 9636 | var isObject = typeof newChild === 'object' && newChild !== null; |
| 9637 | |
| 9638 | if (isObject) { |
| 9639 | switch (newChild.$$typeof) { |
| 9640 | case REACT_ELEMENT_TYPE: |
| 9641 | return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime)); |
| 9642 | case REACT_PORTAL_TYPE: |
| 9643 | return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime)); |
| 9644 | } |
| 9645 | } |
| 9646 | |
| 9647 | if (typeof newChild === 'string' || typeof newChild === 'number') { |
| 9648 | return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime)); |
| 9649 | } |
| 9650 | |
| 9651 | if (isArray$1(newChild)) { |
| 9652 | return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime); |
| 9653 | } |
| 9654 | |
| 9655 | if (getIteratorFn(newChild)) { |
| 9656 | return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime); |
| 9657 | } |
| 9658 | |
| 9659 | if (isObject) { |
| 9660 | throwOnInvalidObjectType(returnFiber, newChild); |
| 9661 | } |
| 9662 | |
| 9663 | { |
| 9664 | if (typeof newChild === 'function') { |
| 9665 | warnOnFunctionType(); |
| 9666 | } |
| 9667 | } |
| 9668 | if (typeof newChild === 'undefined') { |
| 9669 | // If the new child is undefined, and the return fiber is a composite |
| 9670 | // component, throw an error. If Fiber return types are disabled, |
| 9671 | // we already threw above. |
| 9672 | switch (returnFiber.tag) { |
| 9673 | case ClassComponent: |
| 9674 | { |
| 9675 | { |
| 9676 | var instance = returnFiber.stateNode; |
| 9677 | if (instance.render._isMockFunction) { |
| 9678 | // We allow auto-mocks to proceed as if they're returning null. |
| 9679 | break; |
no test coverage detected