MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / reconcileSinglePortal

Function reconcileSinglePortal

code/styling/public/app.js:9592–9617  ·  view source on GitHub ↗
(returnFiber, currentFirstChild, portal, expirationTime)

Source from the content-addressed store, hash-verified

9590 }
9591
9592 function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {
9593 var key = portal.key;
9594 var child = currentFirstChild;
9595 while (child !== null) {
9596 // TODO: If key === null and child.key === null, then this only applies to
9597 // the first item in the list.
9598 if (child.key === key) {
9599 if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
9600 deleteRemainingChildren(returnFiber, child.sibling);
9601 var existing = useFiber(child, portal.children || [], expirationTime);
9602 existing['return'] = returnFiber;
9603 return existing;
9604 } else {
9605 deleteRemainingChildren(returnFiber, child);
9606 break;
9607 }
9608 } else {
9609 deleteChild(returnFiber, child);
9610 }
9611 child = child.sibling;
9612 }
9613
9614 var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);
9615 created['return'] = returnFiber;
9616 return created;
9617 }
9618
9619 // This API will tag the children with the side-effect of the reconciliation
9620 // itself. They will be added to the side-effect list as we pass through the

Callers 1

reconcileChildFibersFunction · 0.70

Calls 4

deleteRemainingChildrenFunction · 0.70
useFiberFunction · 0.70
deleteChildFunction · 0.70
createFiberFromPortalFunction · 0.70

Tested by

no test coverage detected