Home / Function/ takeSnapshot() — react Function Reference

takeSnapshot() — react Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  2743f1aa_8811_26e3_a021_346fb59df244["takeSnapshot()"]
  d898e8d4_bae5_bd1e_6da8_d32cb643c20a["DerivationCache"]
  2743f1aa_8811_26e3_a021_346fb59df244 -->|defined in| d898e8d4_bae5_bd1e_6da8_d32cb643c20a
  f9f36408_8e51_961b_c26d_24ee285bd479["validateNoDerivedComputationsInEffects_exp()"]
  f9f36408_8e51_961b_c26d_24ee285bd479 -->|calls| 2743f1aa_8811_26e3_a021_346fb59df244
  style 2743f1aa_8811_26e3_a021_346fb59df244 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateNoDerivedComputationsInEffects_exp.ts lines 62–72

  takeSnapshot(): void {
    this.previousCache = new Map();
    for (const [key, value] of this.cache.entries()) {
      this.previousCache.set(key, {
        place: value.place,
        sourcesIds: new Set(value.sourcesIds),
        typeOfValue: value.typeOfValue,
        isStateSource: value.isStateSource,
      });
    }
  }

Domain

Subdomains

Frequently Asked Questions

What does takeSnapshot() do?
takeSnapshot() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateNoDerivedComputationsInEffects_exp.ts.
Where is takeSnapshot() defined?
takeSnapshot() is defined in compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateNoDerivedComputationsInEffects_exp.ts at line 62.
What calls takeSnapshot()?
takeSnapshot() is called by 1 function(s): validateNoDerivedComputationsInEffects_exp.

Analyze Your Own Codebase

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

Try Supermodel Free