MCPcopy Index your code
hub / github.com/react/react / updatePortalComponent

Function updatePortalComponent

packages/react-reconciler/src/ReactFiberBeginWork.js:3580–3603  ·  view source on GitHub ↗
(
  current: Fiber | null,
  workInProgress: Fiber,
  renderLanes: Lanes,
)

Source from the content-addressed store, hash-verified

3578}
3579
3580function updatePortalComponent(
3581 current: Fiber | null,
3582 workInProgress: Fiber,
3583 renderLanes: Lanes,
3584) {
3585 pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
3586 const nextChildren = workInProgress.pendingProps;
3587 if (current === null) {
3588 // Portals are special because we don't append the children during mount
3589 // but at commit. Therefore we need to track insertions which the normal
3590 // flow doesn't do during mount. This doesn't happen at the root because
3591 // the root always starts with a "current" with a null child.
3592 // TODO: Consider unifying this with how the root works.
3593 workInProgress.child = reconcileChildFibers(
3594 workInProgress,
3595 null,
3596 nextChildren,
3597 renderLanes,
3598 );
3599 } else {
3600 reconcileChildren(current, workInProgress, nextChildren, renderLanes);
3601 }
3602 return workInProgress.child;
3603}
3604
3605let hasWarnedAboutUsingNoValuePropOnContextProvider = false;
3606

Callers 1

beginWorkFunction · 0.85

Calls 3

pushHostContainerFunction · 0.90
reconcileChildFibersFunction · 0.90
reconcileChildrenFunction · 0.85

Tested by

no test coverage detected