Home / Function/ findFragmentInstanceSiblings() — react Function Reference

findFragmentInstanceSiblings() — react Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  77106965_3eaa_faf7_56a0_8e522fd03948["findFragmentInstanceSiblings()"]
  0dbcf9fa_e6db_e53a_9527_79526654a3ff["ReactFiberTreeReflection.js"]
  77106965_3eaa_faf7_56a0_8e522fd03948 -->|defined in| 0dbcf9fa_e6db_e53a_9527_79526654a3ff
  style 77106965_3eaa_faf7_56a0_8e522fd03948 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberTreeReflection.js lines 440–475

function findFragmentInstanceSiblings(
  result: [Fiber | null, Fiber | null],
  self: Fiber,
  child: null | Fiber,
  foundSelf: boolean = false,
): boolean {
  while (child !== null) {
    if (child === self) {
      foundSelf = true;
      if (child.sibling) {
        child = child.sibling;
      } else {
        return true;
      }
    }
    if (child.tag === HostComponent) {
      if (foundSelf) {
        result[1] = child;
        return true;
      } else {
        result[0] = child;
      }
    } else if (
      child.tag === OffscreenComponent &&
      child.memoizedState !== null
    ) {
      // Skip hidden subtrees
    } else {
      if (findFragmentInstanceSiblings(result, self, child.child, foundSelf)) {
        return true;
      }
    }
    child = child.sibling;
  }
  return false;
}

Domain

Subdomains

Frequently Asked Questions

What does findFragmentInstanceSiblings() do?
findFragmentInstanceSiblings() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberTreeReflection.js.
Where is findFragmentInstanceSiblings() defined?
findFragmentInstanceSiblings() is defined in packages/react-reconciler/src/ReactFiberTreeReflection.js at line 440.

Analyze Your Own Codebase

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

Try Supermodel Free