Home / Function/ createRootErrorUpdate() — react Function Reference

createRootErrorUpdate() — react Function Reference

Architecture documentation for the createRootErrorUpdate() function in ReactFiberThrow.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  ce664b89_0abe_3980_f572_e5b8149834de["createRootErrorUpdate()"]
  2945bdb1_d075_d792_a028_13eee518c9d4["ReactFiberThrow.js"]
  ce664b89_0abe_3980_f572_e5b8149834de -->|defined in| 2945bdb1_d075_d792_a028_13eee518c9d4
  f933a08e_fb14_205d_b7b1_ce3073b61e36["throwException()"]
  f933a08e_fb14_205d_b7b1_ce3073b61e36 -->|calls| ce664b89_0abe_3980_f572_e5b8149834de
  style ce664b89_0abe_3980_f572_e5b8149834de fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberThrow.js lines 93–112

function createRootErrorUpdate(
  root: FiberRoot,
  errorInfo: CapturedValue<mixed>,
  lane: Lane,
): Update<mixed> {
  const update = createUpdate(lane);
  // Unmount the root by rendering null.
  update.tag = CaptureUpdate;
  // Caution: React DevTools currently depends on this property
  // being called "element".
  update.payload = {element: null};
  update.callback = () => {
    if (__DEV__) {
      runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo);
    } else {
      logUncaughtError(root, errorInfo);
    }
  };
  return update;
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does createRootErrorUpdate() do?
createRootErrorUpdate() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberThrow.js.
Where is createRootErrorUpdate() defined?
createRootErrorUpdate() is defined in packages/react-reconciler/src/ReactFiberThrow.js at line 93.
What calls createRootErrorUpdate()?
createRootErrorUpdate() is called by 1 function(s): throwException.

Analyze Your Own Codebase

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

Try Supermodel Free