Home / Function/ constructor() — react Function Reference

constructor() — react Function Reference

Architecture documentation for the constructor() function in HIRBuilder.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  120d83a3_3b47_09ef_b55b_3acb35934a1f["constructor()"]
  d1b85268_f4cd_bc3c_7ba0_ee15dcc8a845["HIRBuilder"]
  120d83a3_3b47_09ef_b55b_3acb35934a1f -->|defined in| d1b85268_f4cd_bc3c_7ba0_ee15dcc8a845
  1ab2841f_8064_e69f_f943_b3bcdeb887c1["constructor()"]
  1ab2841f_8064_e69f_f943_b3bcdeb887c1 -->|calls| 120d83a3_3b47_09ef_b55b_3acb35934a1f
  11080cce_bbf7_2d34_25af_532ed4173235["makeBlockId()"]
  120d83a3_3b47_09ef_b55b_3acb35934a1f -->|calls| 11080cce_bbf7_2d34_25af_532ed4173235
  3c87e791_7408_e104_6c1c_3ada84d97629["newBlock()"]
  120d83a3_3b47_09ef_b55b_3acb35934a1f -->|calls| 3c87e791_7408_e104_6c1c_3ada84d97629
  06231490_89ad_eaa9_37c6_2f754c4cbd27["constructor()"]
  120d83a3_3b47_09ef_b55b_3acb35934a1f -->|calls| 06231490_89ad_eaa9_37c6_2f754c4cbd27
  style 120d83a3_3b47_09ef_b55b_3acb35934a1f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/HIR/HIRBuilder.ts lines 136–149

  constructor(
    env: Environment,
    options?: {
      bindings?: Bindings | null;
      context?: Map<t.Identifier, SourceLocation>;
      entryBlockKind?: BlockKind;
    },
  ) {
    this.#env = env;
    this.#bindings = options?.bindings ?? new Map();
    this.#context = options?.context ?? new Map();
    this.#entry = makeBlockId(env.nextBlockId);
    this.#current = newBlock(this.#entry, options?.entryBlockKind ?? 'block');
  }

Subdomains

Called By

Frequently Asked Questions

What does constructor() do?
constructor() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/HIRBuilder.ts.
Where is constructor() defined?
constructor() is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/HIRBuilder.ts at line 136.
What does constructor() call?
constructor() calls 3 function(s): constructor, makeBlockId, newBlock.
What calls constructor()?
constructor() is called by 1 function(s): constructor.

Analyze Your Own Codebase

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

Try Supermodel Free