Home / File/ error.useMemo-unrelated-mutation-in-depslist.ts — react Source File

error.useMemo-unrelated-mutation-in-depslist.ts — react Source File

Architecture documentation for error.useMemo-unrelated-mutation-in-depslist.ts, a typescript file in the react codebase. 1 imports, 0 dependents.

File typescript TestingUtilities Fixtures 1 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  5ce313d4_9dd8_4442_512c_ca33bb781361["error.useMemo-unrelated-mutation-in-depslist.ts"]
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  5ce313d4_9dd8_4442_512c_ca33bb781361 --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  style 5ce313d4_9dd8_4442_512c_ca33bb781361 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// @validatePreserveExistingMemoizationGuarantees

import {useMemo} from 'react';

// Here, Forget infers that the memo block dependency is input1
// 1. StartMemoize is emitted before the function expression
//    (and thus before the depslist arg and its rvalues)
// 2. x and y's overlapping reactive scopes forces y's reactive
//    scope to be extended to after the `mutate(x)` call, after
//    the StartMemoize instruction.
// While this is technically a false positive, this example would
// already fail the exhaustive-deps eslint rule.
function useFoo(input1) {
  const x = {};
  const y = [input1];
  const memoized = useMemo(() => {
    return [y];
  }, [(mutate(x), y)]);

  return [x, memoized];
}

Subdomains

Functions

Dependencies

  • react

Frequently Asked Questions

What does error.useMemo-unrelated-mutation-in-depslist.ts do?
error.useMemo-unrelated-mutation-in-depslist.ts is a source file in the react codebase, written in typescript. It belongs to the TestingUtilities domain, Fixtures subdomain.
What functions are defined in error.useMemo-unrelated-mutation-in-depslist.ts?
error.useMemo-unrelated-mutation-in-depslist.ts defines 1 function(s): useFoo.
What does error.useMemo-unrelated-mutation-in-depslist.ts depend on?
error.useMemo-unrelated-mutation-in-depslist.ts imports 1 module(s): react.
Where is error.useMemo-unrelated-mutation-in-depslist.ts in the architecture?
error.useMemo-unrelated-mutation-in-depslist.ts is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/error.useMemo-unrelated-mutation-in-depslist.ts (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation).

Analyze Your Own Codebase

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

Try Supermodel Free