(existingChildren, returnFiber, newIdx, newChild, expirationTime)
| 13856 | } |
| 13857 | |
| 13858 | function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) { |
| 13859 | if (typeof newChild === 'string' || typeof newChild === 'number') { |
| 13860 | // Text nodes don't have keys, so we neither have to check the old nor |
| 13861 | // new node for the key. If both are text nodes, they match. |
| 13862 | var matchedFiber = existingChildren.get(newIdx) || null; |
| 13863 | return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime); |
| 13864 | } |
| 13865 | |
| 13866 | if (typeof newChild === 'object' && newChild !== null) { |
| 13867 | switch (newChild.$$typeof) { |
| 13868 | case REACT_ELEMENT_TYPE: |
| 13869 | { |
| 13870 | var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; |
| 13871 | |
| 13872 | if (newChild.type === REACT_FRAGMENT_TYPE) { |
| 13873 | return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key); |
| 13874 | } |
| 13875 | |
| 13876 | return updateElement(returnFiber, _matchedFiber, newChild, expirationTime); |
| 13877 | } |
| 13878 | |
| 13879 | case REACT_PORTAL_TYPE: |
| 13880 | { |
| 13881 | var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; |
| 13882 | |
| 13883 | return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime); |
| 13884 | } |
| 13885 | } |
| 13886 | |
| 13887 | if (isArray$1(newChild) || getIteratorFn(newChild)) { |
| 13888 | var _matchedFiber3 = existingChildren.get(newIdx) || null; |
| 13889 | |
| 13890 | return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null); |
| 13891 | } |
| 13892 | |
| 13893 | throwOnInvalidObjectType(returnFiber, newChild); |
| 13894 | } |
| 13895 | |
| 13896 | { |
| 13897 | if (typeof newChild === 'function') { |
| 13898 | warnOnFunctionType(); |
| 13899 | } |
| 13900 | } |
| 13901 | |
| 13902 | return null; |
| 13903 | } |
| 13904 | /** |
| 13905 | * Warns if there is a duplicate or missing key |
| 13906 | */ |
no test coverage detected