Home / Function/ updateHostText() — react Function Reference

updateHostText() — react Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  18c23582_bfc0_7788_1b51_ade9a9ec414c["updateHostText()"]
  6b05669d_2f09_63a5_e79f_0afc195f25a3["ReactFiberCompleteWork.js"]
  18c23582_bfc0_7788_1b51_ade9a9ec414c -->|defined in| 6b05669d_2f09_63a5_e79f_0afc195f25a3
  0b8db832_87fd_e560_8aa8_e2b319c81626["completeWork()"]
  0b8db832_87fd_e560_8aa8_e2b319c81626 -->|calls| 18c23582_bfc0_7788_1b51_ade9a9ec414c
  62389190_5e71_b961_f5c1_ce663e236915["markUpdate()"]
  18c23582_bfc0_7788_1b51_ade9a9ec414c -->|calls| 62389190_5e71_b961_f5c1_ce663e236915
  caaf30b2_6e58_ce4e_f73c_baa2c3b083d0["getRootHostContainer()"]
  18c23582_bfc0_7788_1b51_ade9a9ec414c -->|calls| caaf30b2_6e58_ce4e_f73c_baa2c3b083d0
  950cf4f4_84e4_d7d6_01b0_f2c00f238dae["getHostContext()"]
  18c23582_bfc0_7788_1b51_ade9a9ec414c -->|calls| 950cf4f4_84e4_d7d6_01b0_f2c00f238dae
  87042ca2_c4f2_9b17_b272_b821412c5923["markCloned()"]
  18c23582_bfc0_7788_1b51_ade9a9ec414c -->|calls| 87042ca2_c4f2_9b17_b272_b821412c5923
  style 18c23582_bfc0_7788_1b51_ade9a9ec414c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberCompleteWork.js lines 664–691

function updateHostText(
  current: Fiber,
  workInProgress: Fiber,
  oldText: string,
  newText: string,
) {
  if (supportsMutation) {
    // If the text differs, mark it as an update. All the work in done in commitWork.
    if (oldText !== newText) {
      markUpdate(workInProgress);
    }
  } else if (supportsPersistence) {
    if (oldText !== newText) {
      // If the text content differs, we'll create a new text instance for it.
      const rootContainerInstance = getRootHostContainer();
      const currentHostContext = getHostContext();
      markCloned(workInProgress);
      workInProgress.stateNode = createTextInstance(
        newText,
        rootContainerInstance,
        currentHostContext,
        workInProgress,
      );
    } else {
      workInProgress.stateNode = current.stateNode;
    }
  }
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does updateHostText() do?
updateHostText() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberCompleteWork.js.
Where is updateHostText() defined?
updateHostText() is defined in packages/react-reconciler/src/ReactFiberCompleteWork.js at line 664.
What does updateHostText() call?
updateHostText() calls 4 function(s): getHostContext, getRootHostContainer, markCloned, markUpdate.
What calls updateHostText()?
updateHostText() 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