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

Function updatePortalComponent

code/third-party/public/app.js:9436–9459  ·  view source on GitHub ↗
(current, workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

9434 }
9435
9436 function updatePortalComponent(current, workInProgress, renderExpirationTime) {
9437 pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
9438 var nextChildren = workInProgress.pendingProps;
9439 if (hasLegacyContextChanged()) {
9440 // Normally we can bail out on props equality but if context has changed
9441 // we don't do the bailout and we have to reuse existing props instead.
9442 } else if (workInProgress.memoizedProps === nextChildren) {
9443 return bailoutOnAlreadyFinishedWork(current, workInProgress);
9444 }
9445
9446 if (current === null) {
9447 // Portals are special because we don't append the children during mount
9448 // but at commit. Therefore we need to track insertions which the normal
9449 // flow doesn't do during mount. This doesn't happen at the root because
9450 // the root always starts with a "current" with a null child.
9451 // TODO: Consider unifying this with how the root works.
9452 workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
9453 memoizeProps(workInProgress, nextChildren);
9454 } else {
9455 reconcileChildren(current, workInProgress, nextChildren);
9456 memoizeProps(workInProgress, nextChildren);
9457 }
9458 return workInProgress.child;
9459 }
9460
9461 function propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) {
9462 var fiber = workInProgress.child;

Callers 1

beginWorkFunction · 0.70

Calls 5

pushHostContainerFunction · 0.70
reconcileChildFibersFunction · 0.70
memoizePropsFunction · 0.70
reconcileChildrenFunction · 0.70

Tested by

no test coverage detected