Home / Function/ updateHostContainer() — react Function Reference

updateHostContainer() — react Function Reference

Architecture documentation for the updateHostContainer() function in ReactFiberCompleteWork.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  3cccd78e_6f36_bda1_da89_ea302f4aca1a["updateHostContainer()"]
  6b05669d_2f09_63a5_e79f_0afc195f25a3["ReactFiberCompleteWork.js"]
  3cccd78e_6f36_bda1_da89_ea302f4aca1a -->|defined in| 6b05669d_2f09_63a5_e79f_0afc195f25a3
  0b8db832_87fd_e560_8aa8_e2b319c81626["completeWork()"]
  0b8db832_87fd_e560_8aa8_e2b319c81626 -->|calls| 3cccd78e_6f36_bda1_da89_ea302f4aca1a
  b22571f1_f869_ca60_b928_0a21847aa17b["doesRequireClone()"]
  3cccd78e_6f36_bda1_da89_ea302f4aca1a -->|calls| b22571f1_f869_ca60_b928_0a21847aa17b
  d6e3ac5e_f6c5_98d7_de25_cdce6cf422bc["appendAllChildrenToContainer()"]
  3cccd78e_6f36_bda1_da89_ea302f4aca1a -->|calls| d6e3ac5e_f6c5_98d7_de25_cdce6cf422bc
  62389190_5e71_b961_f5c1_ce663e236915["markUpdate()"]
  3cccd78e_6f36_bda1_da89_ea302f4aca1a -->|calls| 62389190_5e71_b961_f5c1_ce663e236915
  style 3cccd78e_6f36_bda1_da89_ea302f4aca1a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberCompleteWork.js lines 430–453

function updateHostContainer(current: null | Fiber, workInProgress: Fiber) {
  if (supportsPersistence) {
    if (doesRequireClone(current, workInProgress)) {
      const portalOrRoot: {
        containerInfo: Container,
        pendingChildren: ChildSet,
        ...
      } = workInProgress.stateNode;
      const container = portalOrRoot.containerInfo;
      const newChildSet = createContainerChildSet();
      // If children might have changed, we have to add them all to the set.
      appendAllChildrenToContainer(
        newChildSet,
        workInProgress,
        /* needsVisibilityToggle */ false,
        /* isHidden */ false,
      );
      portalOrRoot.pendingChildren = newChildSet;
      // Schedule an update on the container to swap out the container.
      markUpdate(workInProgress);
      finalizeContainerChildren(container, newChildSet);
    }
  }
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does updateHostContainer() do?
updateHostContainer() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberCompleteWork.js.
Where is updateHostContainer() defined?
updateHostContainer() is defined in packages/react-reconciler/src/ReactFiberCompleteWork.js at line 430.
What does updateHostContainer() call?
updateHostContainer() calls 3 function(s): appendAllChildrenToContainer, doesRequireClone, markUpdate.
What calls updateHostContainer()?
updateHostContainer() is called by 1 function(s): completeWork.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free