Home / Function/ isSubPath() — react Function Reference

isSubPath() — react Function Reference

Architecture documentation for the isSubPath() function in HIR.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  b37c3100_a849_232f_9f94_20a7d4f1e073["isSubPath()"]
  18a78965_f593_105b_e5e8_07001321c2ec["HIR.ts"]
  b37c3100_a849_232f_9f94_20a7d4f1e073 -->|defined in| 18a78965_f593_105b_e5e8_07001321c2ec
  style b37c3100_a849_232f_9f94_20a7d4f1e073 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts lines 1670–1682

export function isSubPath(
  subpath: DependencyPath,
  path: DependencyPath,
): boolean {
  return (
    subpath.length <= path.length &&
    subpath.every(
      (item, ix) =>
        item.property === path[ix].property &&
        item.optional === path[ix].optional,
    )
  );
}

Subdomains

Frequently Asked Questions

What does isSubPath() do?
isSubPath() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts.
Where is isSubPath() defined?
isSubPath() is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts at line 1670.

Analyze Your Own Codebase

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

Try Supermodel Free