Home / Function/ startDefaultTransitionIndicatorIfNeeded() — react Function Reference

startDefaultTransitionIndicatorIfNeeded() — react Function Reference

Architecture documentation for the startDefaultTransitionIndicatorIfNeeded() function in ReactFiberRootScheduler.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  7562ce78_b7ca_a95a_8338_162d9955da19["startDefaultTransitionIndicatorIfNeeded()"]
  a22f22c8_f97a_86c8_be5a_4b91a6a21eab["ReactFiberRootScheduler.js"]
  7562ce78_b7ca_a95a_8338_162d9955da19 -->|defined in| a22f22c8_f97a_86c8_be5a_4b91a6a21eab
  5e2a5e7b_8a85_c79d_5890_361c5a869d24["processRootScheduleInMicrotask()"]
  5e2a5e7b_8a85_c79d_5890_361c5a869d24 -->|calls| 7562ce78_b7ca_a95a_8338_162d9955da19
  style 7562ce78_b7ca_a95a_8338_162d9955da19 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberRootScheduler.js lines 350–382

function startDefaultTransitionIndicatorIfNeeded() {
  if (!enableDefaultTransitionIndicator) {
    return;
  }
  // Check if we need to start an isomorphic indicator like if an async action
  // was started.
  startIsomorphicDefaultIndicatorIfNeeded();
  // Check all the roots if there are any new indicators needed.
  let root = firstScheduledRoot;
  while (root !== null) {
    if (root.indicatorLanes !== NoLanes && root.pendingIndicator === null) {
      // We have new indicator lanes that requires a loading state. Start the
      // default transition indicator.
      if (hasOngoingIsomorphicIndicator()) {
        // We already have an isomorphic indicator going which means it has to
        // also apply to this root since it implies all roots have the same one.
        // We retain this indicator so that it keeps going until we commit this
        // root.
        root.pendingIndicator = retainIsomorphicIndicator();
      } else {
        try {
          const onDefaultTransitionIndicator =
            root.onDefaultTransitionIndicator;
          root.pendingIndicator = onDefaultTransitionIndicator() || noop;
        } catch (x) {
          root.pendingIndicator = noop;
          reportGlobalError(x);
        }
      }
    }
    root = root.next;
  }
}

Domain

Subdomains

Frequently Asked Questions

What does startDefaultTransitionIndicatorIfNeeded() do?
startDefaultTransitionIndicatorIfNeeded() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberRootScheduler.js.
Where is startDefaultTransitionIndicatorIfNeeded() defined?
startDefaultTransitionIndicatorIfNeeded() is defined in packages/react-reconciler/src/ReactFiberRootScheduler.js at line 350.
What calls startDefaultTransitionIndicatorIfNeeded()?
startDefaultTransitionIndicatorIfNeeded() is called by 1 function(s): processRootScheduleInMicrotask.

Analyze Your Own Codebase

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

Try Supermodel Free