(existingChildren, returnFiber, newIdx, newChild, expirationTime)
| 9207 | } |
| 9208 | |
| 9209 | function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) { |
| 9210 | if (typeof newChild === 'string' || typeof newChild === 'number') { |
| 9211 | // Text nodes don't have keys, so we neither have to check the old nor |
| 9212 | // new node for the key. If both are text nodes, they match. |
| 9213 | var matchedFiber = existingChildren.get(newIdx) || null; |
| 9214 | return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime); |
| 9215 | } |
| 9216 | |
| 9217 | if (typeof newChild === 'object' && newChild !== null) { |
| 9218 | switch (newChild.$$typeof) { |
| 9219 | case REACT_ELEMENT_TYPE: |
| 9220 | { |
| 9221 | var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; |
| 9222 | if (newChild.type === REACT_FRAGMENT_TYPE) { |
| 9223 | return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key); |
| 9224 | } |
| 9225 | return updateElement(returnFiber, _matchedFiber, newChild, expirationTime); |
| 9226 | } |
| 9227 | case REACT_PORTAL_TYPE: |
| 9228 | { |
| 9229 | var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; |
| 9230 | return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime); |
| 9231 | } |
| 9232 | } |
| 9233 | |
| 9234 | if (isArray$1(newChild) || getIteratorFn(newChild)) { |
| 9235 | var _matchedFiber3 = existingChildren.get(newIdx) || null; |
| 9236 | return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null); |
| 9237 | } |
| 9238 | |
| 9239 | throwOnInvalidObjectType(returnFiber, newChild); |
| 9240 | } |
| 9241 | |
| 9242 | { |
| 9243 | if (typeof newChild === 'function') { |
| 9244 | warnOnFunctionType(); |
| 9245 | } |
| 9246 | } |
| 9247 | |
| 9248 | return null; |
| 9249 | } |
| 9250 | |
| 9251 | /** |
| 9252 | * Warns if there is a duplicate or missing key |
no test coverage detected