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

Function updatePortalComponent

code/dependency-injection/public/app.js:10296–10319  ·  view source on GitHub ↗
(current, workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

10294 }
10295
10296 function updatePortalComponent(current, workInProgress, renderExpirationTime) {
10297 pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
10298 var nextChildren = workInProgress.pendingProps;
10299 if (hasLegacyContextChanged()) {
10300 // Normally we can bail out on props equality but if context has changed
10301 // we don't do the bailout and we have to reuse existing props instead.
10302 } else if (workInProgress.memoizedProps === nextChildren) {
10303 return bailoutOnAlreadyFinishedWork(current, workInProgress);
10304 }
10305
10306 if (current === null) {
10307 // Portals are special because we don't append the children during mount
10308 // but at commit. Therefore we need to track insertions which the normal
10309 // flow doesn't do during mount. This doesn't happen at the root because
10310 // the root always starts with a "current" with a null child.
10311 // TODO: Consider unifying this with how the root works.
10312 workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
10313 memoizeProps(workInProgress, nextChildren);
10314 } else {
10315 reconcileChildren(current, workInProgress, nextChildren);
10316 memoizeProps(workInProgress, nextChildren);
10317 }
10318 return workInProgress.child;
10319 }
10320
10321 function propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) {
10322 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