(existingChildren, returnFiber, newIdx, newChild, expirationTime)
| 8405 | } |
| 8406 | |
| 8407 | function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) { |
| 8408 | if (typeof newChild === 'string' || typeof newChild === 'number') { |
| 8409 | // Text nodes don't have keys, so we neither have to check the old nor |
| 8410 | // new node for the key. If both are text nodes, they match. |
| 8411 | var matchedFiber = existingChildren.get(newIdx) || null; |
| 8412 | return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime); |
| 8413 | } |
| 8414 | |
| 8415 | if (typeof newChild === 'object' && newChild !== null) { |
| 8416 | switch (newChild.$$typeof) { |
| 8417 | case REACT_ELEMENT_TYPE: |
| 8418 | { |
| 8419 | var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; |
| 8420 | if (newChild.type === REACT_FRAGMENT_TYPE) { |
| 8421 | return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key); |
| 8422 | } |
| 8423 | return updateElement(returnFiber, _matchedFiber, newChild, expirationTime); |
| 8424 | } |
| 8425 | case REACT_PORTAL_TYPE: |
| 8426 | { |
| 8427 | var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; |
| 8428 | return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime); |
| 8429 | } |
| 8430 | } |
| 8431 | |
| 8432 | if (isArray$1(newChild) || getIteratorFn(newChild)) { |
| 8433 | var _matchedFiber3 = existingChildren.get(newIdx) || null; |
| 8434 | return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null); |
| 8435 | } |
| 8436 | |
| 8437 | throwOnInvalidObjectType(returnFiber, newChild); |
| 8438 | } |
| 8439 | |
| 8440 | { |
| 8441 | if (typeof newChild === 'function') { |
| 8442 | warnOnFunctionType(); |
| 8443 | } |
| 8444 | } |
| 8445 | |
| 8446 | return null; |
| 8447 | } |
| 8448 | |
| 8449 | /** |
| 8450 | * Warns if there is a duplicate or missing key |
no test coverage detected