MCPcopy Create free account
hub / github.com/caseywebdev/react-list / updateFromMap

Function updateFromMap

docs/index.js:6512–6581  ·  view source on GitHub ↗
(
    existingChildren,
    returnFiber,
    newIdx,
    newChild,
    lanes
  )

Source from the content-addressed store, hash-verified

6510 return null;
6511 }
6512 function updateFromMap(
6513 existingChildren,
6514 returnFiber,
6515 newIdx,
6516 newChild,
6517 lanes
6518 ) {
6519 if (
6520 ("string" === typeof newChild && "" !== newChild) ||
6521 "number" === typeof newChild ||
6522 "bigint" === typeof newChild
6523 )
6524 return (
6525 (existingChildren = existingChildren.get(newIdx) || null),
6526 updateTextNode(returnFiber, existingChildren, "" + newChild, lanes)
6527 );
6528 if ("object" === typeof newChild && null !== newChild) {
6529 switch (newChild.$$typeof) {
6530 case REACT_ELEMENT_TYPE:
6531 return (
6532 (existingChildren =
6533 existingChildren.get(
6534 null === newChild.key ? newIdx : newChild.key
6535 ) || null),
6536 updateElement(returnFiber, existingChildren, newChild, lanes)
6537 );
6538 case REACT_PORTAL_TYPE:
6539 return (
6540 (existingChildren =
6541 existingChildren.get(
6542 null === newChild.key ? newIdx : newChild.key
6543 ) || null),
6544 updatePortal(returnFiber, existingChildren, newChild, lanes)
6545 );
6546 case REACT_LAZY_TYPE:
6547 var init = newChild._init;
6548 newChild = init(newChild._payload);
6549 return updateFromMap(
6550 existingChildren,
6551 returnFiber,
6552 newIdx,
6553 newChild,
6554 lanes
6555 );
6556 }
6557 if (isArrayImpl(newChild) || getIteratorFn(newChild))
6558 return (
6559 (existingChildren = existingChildren.get(newIdx) || null),
6560 updateFragment(returnFiber, existingChildren, newChild, lanes, null)
6561 );
6562 if ("function" === typeof newChild.then)
6563 return updateFromMap(
6564 existingChildren,
6565 returnFiber,
6566 newIdx,
6567 unwrapThenable(newChild),
6568 lanes
6569 );

Callers 2

reconcileChildrenArrayFunction · 0.85

Calls 11

updateTextNodeFunction · 0.85
updateElementFunction · 0.85
updatePortalFunction · 0.85
getIteratorFnFunction · 0.85
updateFragmentFunction · 0.85
unwrapThenableFunction · 0.85
throwOnInvalidObjectTypeFunction · 0.85
pushDebugInfoFunction · 0.85
warnOnFunctionTypeFunction · 0.85
warnOnSymbolTypeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…