Home / Function/ validate() — react Function Reference

validate() — react Function Reference

Architecture documentation for the validate() function in AssertConsistentIdentifiers.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  2d5af54d_63a3_470d_02e8_a6c9fbb9f052["validate()"]
  277c518d_edde_d1c4_b70b_db27c08ecf93["AssertConsistentIdentifiers.ts"]
  2d5af54d_63a3_470d_02e8_a6c9fbb9f052 -->|defined in| 277c518d_edde_d1c4_b70b_db27c08ecf93
  505f2e0b_d43c_5972_8865_373d0dd08a6a["assertConsistentIdentifiers()"]
  505f2e0b_d43c_5972_8865_373d0dd08a6a -->|calls| 2d5af54d_63a3_470d_02e8_a6c9fbb9f052
  041ca752_10c1_3cda_1f5c_02f44a01310e["invariant()"]
  2d5af54d_63a3_470d_02e8_a6c9fbb9f052 -->|calls| 041ca752_10c1_3cda_1f5c_02f44a01310e
  style 2d5af54d_63a3_470d_02e8_a6c9fbb9f052 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/HIR/AssertConsistentIdentifiers.ts lines 66–81

function validate(
  identifiers: Identifiers,
  identifier: Identifier,
  loc: SourceLocation | null = null,
): void {
  const previous = identifiers.get(identifier.id);
  if (previous === undefined) {
    identifiers.set(identifier.id, identifier);
  } else {
    CompilerError.invariant(identifier === previous, {
      reason: `Duplicate identifier object`,
      description: `Found duplicate identifier object for id ${identifier.id}`,
      loc: loc ?? GeneratedSource,
    });
  }
}

Subdomains

Calls

Frequently Asked Questions

What does validate() do?
validate() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/AssertConsistentIdentifiers.ts.
Where is validate() defined?
validate() is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/AssertConsistentIdentifiers.ts at line 66.
What does validate() call?
validate() calls 1 function(s): invariant.
What calls validate()?
validate() is called by 1 function(s): assertConsistentIdentifiers.

Analyze Your Own Codebase

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

Try Supermodel Free