Home / Function/ state() — react Function Reference

state() — react Function Reference

Architecture documentation for the state() function in EnterSSA.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  22130362_6f7b_966d_4373_b384767b7acf["state()"]
  f11adc00_6af6_2575_4ee8_974e26f2a6ed["SSABuilder"]
  22130362_6f7b_966d_4373_b384767b7acf -->|defined in| f11adc00_6af6_2575_4ee8_974e26f2a6ed
  1bda4538_293e_48ce_ea89_3160033e51b6["definePlace()"]
  1bda4538_293e_48ce_ea89_3160033e51b6 -->|calls| 22130362_6f7b_966d_4373_b384767b7acf
  041ca752_10c1_3cda_1f5c_02f44a01310e["invariant()"]
  22130362_6f7b_966d_4373_b384767b7acf -->|calls| 041ca752_10c1_3cda_1f5c_02f44a01310e
  style 22130362_6f7b_966d_4373_b384767b7acf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/SSA/EnterSSA.ts lines 70–76

  state(): State {
    CompilerError.invariant(this.#current !== null, {
      reason: 'we need to be in a block to access state!',
      loc: GeneratedSource,
    });
    return this.#states.get(this.#current)!;
  }

Subdomains

Calls

Called By

Frequently Asked Questions

What does state() do?
state() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/SSA/EnterSSA.ts.
Where is state() defined?
state() is defined in compiler/packages/babel-plugin-react-compiler/src/SSA/EnterSSA.ts at line 70.
What does state() call?
state() calls 1 function(s): invariant.
What calls state()?
state() is called by 1 function(s): definePlace.

Analyze Your Own Codebase

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

Try Supermodel Free