Home / Function/ traverseVisibleHostChildren() — react Function Reference

traverseVisibleHostChildren() — react Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  d7ba2e50_69a9_4e51_fd8d_2b092bdff059["traverseVisibleHostChildren()"]
  b49c4002_4b07_c5b1_6176_4a2d8030e11e["ReactFiberTreeReflection.js"]
  d7ba2e50_69a9_4e51_fd8d_2b092bdff059 -->|defined in| b49c4002_4b07_c5b1_6176_4a2d8030e11e
  style d7ba2e50_69a9_4e51_fd8d_2b092bdff059 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberTreeReflection.js lines 368–398

function traverseVisibleHostChildren<A, B, C>(
  child: Fiber | null,
  searchWithinHosts: boolean,
  fn: (Fiber, A, B, C) => boolean,
  a: A,
  b: B,
  c: C,
): boolean {
  while (child !== null) {
    const isHostNode =
      child.tag === HostComponent ||
      (enableFragmentRefsTextNodes && child.tag === HostText);
    if (isHostNode && fn(child, a, b, c)) {
      return true;
    } else if (
      child.tag === OffscreenComponent &&
      child.memoizedState !== null
    ) {
      // Skip hidden subtrees
    } else {
      if (
        (searchWithinHosts || child.tag !== HostComponent) &&
        traverseVisibleHostChildren(child.child, searchWithinHosts, fn, a, b, c)
      ) {
        return true;
      }
    }
    child = child.sibling;
  }
  return false;
}

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free