MCPcopy
hub / github.com/react/react / updateHostContainer

Function updateHostContainer

packages/react-reconciler/src/ReactFiberCompleteWork.js:428–451  ·  view source on GitHub ↗
(current: null | Fiber, workInProgress: Fiber)

Source from the content-addressed store, hash-verified

426}
427
428function updateHostContainer(current: null | Fiber, workInProgress: Fiber) {
429 if (supportsPersistence) {
430 if (doesRequireClone(current, workInProgress)) {
431 const portalOrRoot: {
432 containerInfo: Container,
433 pendingChildren: ChildSet,
434 ...
435 } = workInProgress.stateNode;
436 const container = portalOrRoot.containerInfo;
437 const newChildSet = createContainerChildSet();
438 // If children might have changed, we have to add them all to the set.
439 appendAllChildrenToContainer(
440 newChildSet,
441 workInProgress,
442 /* needsVisibilityToggle */ false,
443 /* isHidden */ false,
444 );
445 portalOrRoot.pendingChildren = newChildSet;
446 // Schedule an update on the container to swap out the container.
447 markUpdate(workInProgress);
448 finalizeContainerChildren(container, newChildSet);
449 }
450 }
451}
452
453function updateHostComponent(
454 current: Fiber,

Callers 1

completeWorkFunction · 0.85

Calls 5

createContainerChildSetFunction · 0.90
doesRequireCloneFunction · 0.85
markUpdateFunction · 0.85

Tested by

no test coverage detected