Home / File/ useMemo-mabye-modified-free-variable-dont-preserve-memoization-guarantees.js — react Source File

useMemo-mabye-modified-free-variable-dont-preserve-memoization-guarantees.js — react Source File

Architecture documentation for useMemo-mabye-modified-free-variable-dont-preserve-memoization-guarantees.js, a javascript file in the react codebase. 2 imports, 0 dependents.

File javascript TestingUtilities Fixtures 2 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  2f1c8307_ac3a_ca2f_887d_3a3536838e55["useMemo-mabye-modified-free-variable-dont-preserve-memoization-guarantees.js"]
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  2f1c8307_ac3a_ca2f_887d_3a3536838e55 --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"]
  2f1c8307_ac3a_ca2f_887d_3a3536838e55 --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05
  style 2f1c8307_ac3a_ca2f_887d_3a3536838e55 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// @enablePreserveExistingMemoizationGuarantees:false @validateExhaustiveMemoizationDependencies:false
import {useMemo} from 'react';
import {identity, makeObject_Primitives, mutate, useHook} from 'shared-runtime';

function Component(props) {
  // With the feature disabled these variables are inferred as being mutated inside the useMemo block
  const free = makeObject_Primitives();
  const free2 = makeObject_Primitives();
  const part = free2.part;

  // This causes their range to extend to include this hook call, and in turn for the memoization to be pruned
  useHook();
  const object = useMemo(() => {
    const x = makeObject_Primitives();
    x.value = props.value;
    mutate(x, free, part);
    return x;
  }, [props.value]);

  identity(free);
  identity(part);
  return object;
}

export const FIXTURE_ENTRYPOINT = {
  fn: Component,
  params: [{value: 42}],
};

Subdomains

Functions

Dependencies

  • react
  • shared-runtime

Frequently Asked Questions

What does useMemo-mabye-modified-free-variable-dont-preserve-memoization-guarantees.js do?
useMemo-mabye-modified-free-variable-dont-preserve-memoization-guarantees.js is a source file in the react codebase, written in javascript. It belongs to the TestingUtilities domain, Fixtures subdomain.
What functions are defined in useMemo-mabye-modified-free-variable-dont-preserve-memoization-guarantees.js?
useMemo-mabye-modified-free-variable-dont-preserve-memoization-guarantees.js defines 1 function(s): Component.
What does useMemo-mabye-modified-free-variable-dont-preserve-memoization-guarantees.js depend on?
useMemo-mabye-modified-free-variable-dont-preserve-memoization-guarantees.js imports 2 module(s): react, shared-runtime.
Where is useMemo-mabye-modified-free-variable-dont-preserve-memoization-guarantees.js in the architecture?
useMemo-mabye-modified-free-variable-dont-preserve-memoization-guarantees.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-mabye-modified-free-variable-dont-preserve-memoization-guarantees.js (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler).

Analyze Your Own Codebase

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

Try Supermodel Free