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

Function updatePortalComponent

code/styling/public/app.js:10203–10226  ·  view source on GitHub ↗
(current, workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

10201 }
10202
10203 function updatePortalComponent(current, workInProgress, renderExpirationTime) {
10204 pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
10205 var nextChildren = workInProgress.pendingProps;
10206 if (hasLegacyContextChanged()) {
10207 // Normally we can bail out on props equality but if context has changed
10208 // we don't do the bailout and we have to reuse existing props instead.
10209 } else if (workInProgress.memoizedProps === nextChildren) {
10210 return bailoutOnAlreadyFinishedWork(current, workInProgress);
10211 }
10212
10213 if (current === null) {
10214 // Portals are special because we don't append the children during mount
10215 // but at commit. Therefore we need to track insertions which the normal
10216 // flow doesn't do during mount. This doesn't happen at the root because
10217 // the root always starts with a "current" with a null child.
10218 // TODO: Consider unifying this with how the root works.
10219 workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
10220 memoizeProps(workInProgress, nextChildren);
10221 } else {
10222 reconcileChildren(current, workInProgress, nextChildren);
10223 memoizeProps(workInProgress, nextChildren);
10224 }
10225 return workInProgress.child;
10226 }
10227
10228 function propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) {
10229 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