Home / Function/ recursivelyTraversePassiveMountEffects() — react Function Reference

recursivelyTraversePassiveMountEffects() — react Function Reference

Architecture documentation for the recursivelyTraversePassiveMountEffects() function in ReactFiberCommitWork.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  c48b98f7_7633_34a8_3e32_977f9b8453fe["recursivelyTraversePassiveMountEffects()"]
  e0fbfbd5_47b0_a489_0b36_bbfad9245544["ReactFiberCommitWork.js"]
  c48b98f7_7633_34a8_3e32_977f9b8453fe -->|defined in| e0fbfbd5_47b0_a489_0b36_bbfad9245544
  07f3c6d9_2fce_51ae_4408_e0d4ab7359a1["commitPassiveMountOnFiber()"]
  07f3c6d9_2fce_51ae_4408_e0d4ab7359a1 -->|calls| c48b98f7_7633_34a8_3e32_977f9b8453fe
  07f3c6d9_2fce_51ae_4408_e0d4ab7359a1["commitPassiveMountOnFiber()"]
  c48b98f7_7633_34a8_3e32_977f9b8453fe -->|calls| 07f3c6d9_2fce_51ae_4408_e0d4ab7359a1
  style c48b98f7_7633_34a8_3e32_977f9b8453fe fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberCommitWork.js lines 3512–3567

function recursivelyTraversePassiveMountEffects(
  root: FiberRoot,
  parentFiber: Fiber,
  committedLanes: Lanes,
  committedTransitions: Array<Transition> | null,
  endTime: number, // Profiling-only. The start time of the next Fiber or root completion.
) {
  const isViewTransitionEligible =
    enableViewTransition &&
    includesOnlyViewTransitionEligibleLanes(committedLanes);
  // TODO: We could optimize this by marking these with the Passive subtree flag in the render phase.
  const subtreeMask = isViewTransitionEligible
    ? PassiveTransitionMask
    : PassiveMask;
  if (
    parentFiber.subtreeFlags & subtreeMask ||
    // If this subtree rendered with profiling this commit, we need to visit it to log it.
    (enableProfilerTimer &&
      enableComponentPerformanceTrack &&
      parentFiber.actualDuration !== 0 &&
      (parentFiber.alternate === null ||
        parentFiber.alternate.child !== parentFiber.child))
  ) {
    let child = parentFiber.child;
    while (child !== null) {
      if (enableProfilerTimer && enableComponentPerformanceTrack) {
        const nextSibling = child.sibling;
        commitPassiveMountOnFiber(
          root,
          child,
          committedLanes,
          committedTransitions,
          nextSibling !== null
            ? ((nextSibling.actualStartTime: any): number)
            : endTime,
        );
        child = nextSibling;
      } else {
        commitPassiveMountOnFiber(
          root,
          child,
          committedLanes,
          committedTransitions,
          0,
        );
        child = child.sibling;
      }
    }
  } else if (isViewTransitionEligible) {
    // We are inside an updated subtree. Any mutations that affected the
    // parent HostInstance's layout or set of children (such as reorders)
    // might have also affected the positioning or size of the inner
    // ViewTransitions. Therefore we need to restore those too.
    restoreNestedViewTransitions(parentFiber);
  }
}

Domain

Subdomains

Frequently Asked Questions

What does recursivelyTraversePassiveMountEffects() do?
recursivelyTraversePassiveMountEffects() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberCommitWork.js.
Where is recursivelyTraversePassiveMountEffects() defined?
recursivelyTraversePassiveMountEffects() is defined in packages/react-reconciler/src/ReactFiberCommitWork.js at line 3512.
What does recursivelyTraversePassiveMountEffects() call?
recursivelyTraversePassiveMountEffects() calls 1 function(s): commitPassiveMountOnFiber.
What calls recursivelyTraversePassiveMountEffects()?
recursivelyTraversePassiveMountEffects() is called by 1 function(s): commitPassiveMountOnFiber.

Analyze Your Own Codebase

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

Try Supermodel Free