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

Function reconcileSinglePortal

code/dependency-injection/public/app.js:9685–9710  ·  view source on GitHub ↗
(returnFiber, currentFirstChild, portal, expirationTime)

Source from the content-addressed store, hash-verified

9683 }
9684
9685 function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {
9686 var key = portal.key;
9687 var child = currentFirstChild;
9688 while (child !== null) {
9689 // TODO: If key === null and child.key === null, then this only applies to
9690 // the first item in the list.
9691 if (child.key === key) {
9692 if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
9693 deleteRemainingChildren(returnFiber, child.sibling);
9694 var existing = useFiber(child, portal.children || [], expirationTime);
9695 existing['return'] = returnFiber;
9696 return existing;
9697 } else {
9698 deleteRemainingChildren(returnFiber, child);
9699 break;
9700 }
9701 } else {
9702 deleteChild(returnFiber, child);
9703 }
9704 child = child.sibling;
9705 }
9706
9707 var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);
9708 created['return'] = returnFiber;
9709 return created;
9710 }
9711
9712 // This API will tag the children with the side-effect of the reconciliation
9713 // 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