Home / File/ transitivity-phi-assign-or-capture.tsx — react Source File

transitivity-phi-assign-or-capture.tsx — react Source File

Architecture documentation for transitivity-phi-assign-or-capture.tsx, a tsx file in the react codebase. 2 imports, 0 dependents.

File tsx TestingUtilities Fixtures 2 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  f250fac4_4bc8_1e0c_1857_08f3201297f8["transitivity-phi-assign-or-capture.tsx"]
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  f250fac4_4bc8_1e0c_1857_08f3201297f8 --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"]
  f250fac4_4bc8_1e0c_1857_08f3201297f8 --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05
  style f250fac4_4bc8_1e0c_1857_08f3201297f8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// @enablePreserveExistingMemoizationGuarantees:false @validateExhaustiveMemoizationDependencies:false
import {useMemo} from 'react';
import {
  typedCapture,
  typedCreateFrom,
  typedMutate,
  ValidateMemoization,
} from 'shared-runtime';

function Component({a, b}) {
  const x = useMemo(() => [{a}], [a, b]);
  let z: any;
  if (b) {
    z = x;
  } else {
    z = typedCapture(x);
  }
  // could mutate x
  typedMutate(z, b);

  return <ValidateMemoization inputs={[a, b]} output={x} />;
}

export const FIXTURE_ENTRYPOINT = {
  fn: Component,
  params: [{a: 0, b: 0}],
  sequentialRenders: [
    {a: 0, b: 0},
    {a: 0, b: 1},
    {a: 1, b: 1},
    {a: 0, b: 0},
  ],
};

Subdomains

Functions

Dependencies

  • react
  • shared-runtime

Frequently Asked Questions

What does transitivity-phi-assign-or-capture.tsx do?
transitivity-phi-assign-or-capture.tsx is a source file in the react codebase, written in tsx. It belongs to the TestingUtilities domain, Fixtures subdomain.
What functions are defined in transitivity-phi-assign-or-capture.tsx?
transitivity-phi-assign-or-capture.tsx defines 1 function(s): Component.
What does transitivity-phi-assign-or-capture.tsx depend on?
transitivity-phi-assign-or-capture.tsx imports 2 module(s): react, shared-runtime.
Where is transitivity-phi-assign-or-capture.tsx in the architecture?
transitivity-phi-assign-or-capture.tsx is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-mutability/transitivity-phi-assign-or-capture.tsx (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-mutability).

Analyze Your Own Codebase

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

Try Supermodel Free