Home / Function/ doesFiberContain() — react Function Reference

doesFiberContain() — react Function Reference

Architecture documentation for the doesFiberContain() function in ReactFiberTreeReflection.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  c0a65d94_b34a_97ec_7298_10d943a24e28["doesFiberContain()"]
  0dbcf9fa_e6db_e53a_9527_79526654a3ff["ReactFiberTreeReflection.js"]
  c0a65d94_b34a_97ec_7298_10d943a24e28 -->|defined in| 0dbcf9fa_e6db_e53a_9527_79526654a3ff
  ea3bf626_4e45_2dc4_e991_d010004126f3["commitBeforeMutationEffectsOnFiber()"]
  ea3bf626_4e45_2dc4_e991_d010004126f3 -->|calls| c0a65d94_b34a_97ec_7298_10d943a24e28
  e4b3ff8b_fac9_8119_fde8_1dc24b64f56d["commitBeforeMutationEffectsDeletion()"]
  e4b3ff8b_fac9_8119_fde8_1dc24b64f56d -->|calls| c0a65d94_b34a_97ec_7298_10d943a24e28
  style c0a65d94_b34a_97ec_7298_10d943a24e28 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberTreeReflection.js lines 333–346

export function doesFiberContain(
  parentFiber: Fiber,
  childFiber: Fiber,
): boolean {
  let node: null | Fiber = childFiber;
  const parentFiberAlternate = parentFiber.alternate;
  while (node !== null) {
    if (node === parentFiber || node === parentFiberAlternate) {
      return true;
    }
    node = node.return;
  }
  return false;
}

Domain

Subdomains

Frequently Asked Questions

What does doesFiberContain() do?
doesFiberContain() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberTreeReflection.js.
Where is doesFiberContain() defined?
doesFiberContain() is defined in packages/react-reconciler/src/ReactFiberTreeReflection.js at line 333.
What calls doesFiberContain()?
doesFiberContain() is called by 2 function(s): commitBeforeMutationEffectsDeletion, commitBeforeMutationEffectsOnFiber.

Analyze Your Own Codebase

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

Try Supermodel Free