Home / Function/ freezeValue() — react Function Reference

freezeValue() — react Function Reference

Architecture documentation for the freezeValue() function in InferMutationAliasingEffects.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  1d094e55_9813_8516_4c4f_a471e85cee29["freezeValue()"]
  7f9a06c8_8e18_76fc_0edd_1f0d608aae44["InferenceState"]
  1d094e55_9813_8516_4c4f_a471e85cee29 -->|defined in| 7f9a06c8_8e18_76fc_0edd_1f0d608aae44
  e0e4be16_6524_e844_c68d_262036cf06e3["freeze()"]
  e0e4be16_6524_e844_c68d_262036cf06e3 -->|calls| 1d094e55_9813_8516_4c4f_a471e85cee29
  e0e4be16_6524_e844_c68d_262036cf06e3["freeze()"]
  1d094e55_9813_8516_4c4f_a471e85cee29 -->|calls| e0e4be16_6524_e844_c68d_262036cf06e3
  style 1d094e55_9813_8516_4c4f_a471e85cee29 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Inference/InferMutationAliasingEffects.ts lines 1461–1475

  freezeValue(value: InstructionValue, reason: ValueReason): void {
    this.#values.set(value, {
      kind: ValueKind.Frozen,
      reason: new Set([reason]),
    });
    if (
      value.kind === 'FunctionExpression' &&
      (this.env.config.enablePreserveExistingMemoizationGuarantees ||
        this.env.config.enableTransitivelyFreezeFunctionExpressions)
    ) {
      for (const place of value.loweredFunc.func.context) {
        this.freeze(place, reason);
      }
    }
  }

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does freezeValue() do?
freezeValue() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Inference/InferMutationAliasingEffects.ts.
Where is freezeValue() defined?
freezeValue() is defined in compiler/packages/babel-plugin-react-compiler/src/Inference/InferMutationAliasingEffects.ts at line 1461.
What does freezeValue() call?
freezeValue() calls 1 function(s): freeze.
What calls freezeValue()?
freezeValue() is called by 1 function(s): freeze.

Analyze Your Own Codebase

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

Try Supermodel Free