Home / Function/ getRootSetState() — react Function Reference

getRootSetState() — react Function Reference

Architecture documentation for the getRootSetState() function in ValidateNoDerivedComputationsInEffects_exp.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  58133747_182e_d838_f59c_07fbac51ed59["getRootSetState()"]
  a38a9d1f_969c_8056_aa80_6cb5fedba226["ValidateNoDerivedComputationsInEffects_exp.ts"]
  58133747_182e_d838_f59c_07fbac51ed59 -->|defined in| a38a9d1f_969c_8056_aa80_6cb5fedba226
  d206b1f3_3227_c6ab_9a06_aa3ed56d36cf["maybeRecordSetState()"]
  d206b1f3_3227_c6ab_9a06_aa3ed56d36cf -->|calls| 58133747_182e_d838_f59c_07fbac51ed59
  23e95905_7740_9185_1ad6_1a529d6f88ad["recordInstructionDerivations()"]
  23e95905_7740_9185_1ad6_1a529d6f88ad -->|calls| 58133747_182e_d838_f59c_07fbac51ed59
  8014ef2c_7e1b_b1da_b888_615d609f3c01["validateEffect()"]
  8014ef2c_7e1b_b1da_b888_615d609f3c01 -->|calls| 58133747_182e_d838_f59c_07fbac51ed59
  style 58133747_182e_d838_f59c_07fbac51ed59 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateNoDerivedComputationsInEffects_exp.ts lines 299–320

function getRootSetState(
  key: IdentifierId,
  loads: Map<IdentifierId, IdentifierId | null>,
  visited: Set<IdentifierId> = new Set(),
): IdentifierId | null {
  if (visited.has(key)) {
    return null;
  }
  visited.add(key);

  const parentId = loads.get(key);

  if (parentId === undefined) {
    return null;
  }

  if (parentId === null) {
    return key;
  }

  return getRootSetState(parentId, loads, visited);
}

Domain

Subdomains

Frequently Asked Questions

What does getRootSetState() do?
getRootSetState() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateNoDerivedComputationsInEffects_exp.ts.
Where is getRootSetState() defined?
getRootSetState() is defined in compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateNoDerivedComputationsInEffects_exp.ts at line 299.
What calls getRootSetState()?
getRootSetState() is called by 3 function(s): maybeRecordSetState, recordInstructionDerivations, validateEffect.

Analyze Your Own Codebase

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

Try Supermodel Free