Home / Function/ addDependency() — react Function Reference

addDependency() — react Function Reference

Architecture documentation for the addDependency() function in ValidateExhaustiveDependencies.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  46593a4e_807a_197c_d744_cd6939fec7c8["addDependency()"]
  6bd4cea3_f214_b2ef_722d_79dc0c7aa5d2["ValidateExhaustiveDependencies.ts"]
  46593a4e_807a_197c_d744_cd6939fec7c8 -->|defined in| 6bd4cea3_f214_b2ef_722d_79dc0c7aa5d2
  dae9c43e_da49_8800_2ece_83d53b76089f["visitCandidateDependency()"]
  dae9c43e_da49_8800_2ece_83d53b76089f -->|calls| 46593a4e_807a_197c_d744_cd6939fec7c8
  a944430b_6530_c4fe_e506_100c03dda40e["collectDependencies()"]
  a944430b_6530_c4fe_e506_100c03dda40e -->|calls| 46593a4e_807a_197c_d744_cd6939fec7c8
  style 46593a4e_807a_197c_d744_cd6939fec7c8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateExhaustiveDependencies.ts lines 497–511

function addDependency(
  dep: Temporary,
  dependencies: Set<InferredDependency>,
  locals: Set<IdentifierId>,
): void {
  if (dep.kind === 'Aggregate') {
    for (const x of dep.dependencies) {
      addDependency(x, dependencies, locals);
    }
  } else if (dep.kind === 'Global') {
    dependencies.add(dep);
  } else if (!locals.has(dep.identifier.id)) {
    dependencies.add(dep);
  }
}

Domain

Subdomains

Frequently Asked Questions

What does addDependency() do?
addDependency() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateExhaustiveDependencies.ts.
Where is addDependency() defined?
addDependency() is defined in compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateExhaustiveDependencies.ts at line 497.
What calls addDependency()?
addDependency() is called by 2 function(s): collectDependencies, visitCandidateDependency.

Analyze Your Own Codebase

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

Try Supermodel Free