(returnFiber, oldFiber, newChild, expirationTime)
| 8347 | } |
| 8348 | |
| 8349 | function updateSlot(returnFiber, oldFiber, newChild, expirationTime) { |
| 8350 | // Update the fiber if the keys match, otherwise return null. |
| 8351 | |
| 8352 | var key = oldFiber !== null ? oldFiber.key : null; |
| 8353 | |
| 8354 | if (typeof newChild === 'string' || typeof newChild === 'number') { |
| 8355 | // Text nodes don't have keys. If the previous node is implicitly keyed |
| 8356 | // we can continue to replace it without aborting even if it is not a text |
| 8357 | // node. |
| 8358 | if (key !== null) { |
| 8359 | return null; |
| 8360 | } |
| 8361 | return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime); |
| 8362 | } |
| 8363 | |
| 8364 | if (typeof newChild === 'object' && newChild !== null) { |
| 8365 | switch (newChild.$$typeof) { |
| 8366 | case REACT_ELEMENT_TYPE: |
| 8367 | { |
| 8368 | if (newChild.key === key) { |
| 8369 | if (newChild.type === REACT_FRAGMENT_TYPE) { |
| 8370 | return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key); |
| 8371 | } |
| 8372 | return updateElement(returnFiber, oldFiber, newChild, expirationTime); |
| 8373 | } else { |
| 8374 | return null; |
| 8375 | } |
| 8376 | } |
| 8377 | case REACT_PORTAL_TYPE: |
| 8378 | { |
| 8379 | if (newChild.key === key) { |
| 8380 | return updatePortal(returnFiber, oldFiber, newChild, expirationTime); |
| 8381 | } else { |
| 8382 | return null; |
| 8383 | } |
| 8384 | } |
| 8385 | } |
| 8386 | |
| 8387 | if (isArray$1(newChild) || getIteratorFn(newChild)) { |
| 8388 | if (key !== null) { |
| 8389 | return null; |
| 8390 | } |
| 8391 | |
| 8392 | return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null); |
| 8393 | } |
| 8394 | |
| 8395 | throwOnInvalidObjectType(returnFiber, newChild); |
| 8396 | } |
| 8397 | |
| 8398 | { |
| 8399 | if (typeof newChild === 'function') { |
| 8400 | warnOnFunctionType(); |
| 8401 | } |
| 8402 | } |
| 8403 | |
| 8404 | return null; |
| 8405 | } |
| 8406 |
no test coverage detected