Home / Function/ visitReassignment() — react Function Reference

visitReassignment() — react Function Reference

Architecture documentation for the visitReassignment() function in PropagateScopeDependenciesHIR.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  0b9af218_0f18_832f_3f27_3909263220a0["visitReassignment()"]
  1be3b542_2ecf_364c_adef_6e5675b7385e["DependencyCollectionContext"]
  0b9af218_0f18_832f_3f27_3909263220a0 -->|defined in| 1be3b542_2ecf_364c_adef_6e5675b7385e
  fe7b2dbb_34c7_f07a_c558_c479a9c5eb1e["handleInstruction()"]
  fe7b2dbb_34c7_f07a_c558_c479a9c5eb1e -->|calls| 0b9af218_0f18_832f_3f27_3909263220a0
  527555c0_9544_ae6b_5f83_952272d2caa1["Iterable_some()"]
  0b9af218_0f18_832f_3f27_3909263220a0 -->|calls| 527555c0_9544_ae6b_5f83_952272d2caa1
  style 0b9af218_0f18_832f_3f27_3909263220a0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/HIR/PropagateScopeDependenciesHIR.ts lines 616–633

  visitReassignment(place: Place): void {
    const currentScope = this.currentScope.value;
    if (
      currentScope != null &&
      !Iterable_some(
        currentScope.reassignments,
        identifier =>
          identifier.declarationId === place.identifier.declarationId,
      ) &&
      this.#checkValidDependency({
        identifier: place.identifier,
        reactive: place.reactive,
        path: [],
      })
    ) {
      currentScope.reassignments.add(place.identifier);
    }
  }

Subdomains

Frequently Asked Questions

What does visitReassignment() do?
visitReassignment() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/PropagateScopeDependenciesHIR.ts.
Where is visitReassignment() defined?
visitReassignment() is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/PropagateScopeDependenciesHIR.ts at line 616.
What does visitReassignment() call?
visitReassignment() calls 1 function(s): Iterable_some.
What calls visitReassignment()?
visitReassignment() is called by 1 function(s): handleInstruction.

Analyze Your Own Codebase

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

Try Supermodel Free