(existingChildren, returnFiber, newIdx, newChild, expirationTime)
| 9265 | } |
| 9266 | |
| 9267 | function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) { |
| 9268 | if (typeof newChild === 'string' || typeof newChild === 'number') { |
| 9269 | // Text nodes don't have keys, so we neither have to check the old nor |
| 9270 | // new node for the key. If both are text nodes, they match. |
| 9271 | var matchedFiber = existingChildren.get(newIdx) || null; |
| 9272 | return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime); |
| 9273 | } |
| 9274 | |
| 9275 | if (typeof newChild === 'object' && newChild !== null) { |
| 9276 | switch (newChild.$$typeof) { |
| 9277 | case REACT_ELEMENT_TYPE: |
| 9278 | { |
| 9279 | var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; |
| 9280 | if (newChild.type === REACT_FRAGMENT_TYPE) { |
| 9281 | return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key); |
| 9282 | } |
| 9283 | return updateElement(returnFiber, _matchedFiber, newChild, expirationTime); |
| 9284 | } |
| 9285 | case REACT_PORTAL_TYPE: |
| 9286 | { |
| 9287 | var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; |
| 9288 | return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime); |
| 9289 | } |
| 9290 | } |
| 9291 | |
| 9292 | if (isArray$1(newChild) || getIteratorFn(newChild)) { |
| 9293 | var _matchedFiber3 = existingChildren.get(newIdx) || null; |
| 9294 | return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null); |
| 9295 | } |
| 9296 | |
| 9297 | throwOnInvalidObjectType(returnFiber, newChild); |
| 9298 | } |
| 9299 | |
| 9300 | { |
| 9301 | if (typeof newChild === 'function') { |
| 9302 | warnOnFunctionType(); |
| 9303 | } |
| 9304 | } |
| 9305 | |
| 9306 | return null; |
| 9307 | } |
| 9308 | |
| 9309 | /** |
| 9310 | * Warns if there is a duplicate or missing key |
no test coverage detected