Home / File/ hook-call-freezes-captured-memberexpr.tsx — react Source File

hook-call-freezes-captured-memberexpr.tsx — react Source File

Architecture documentation for hook-call-freezes-captured-memberexpr.tsx, a tsx file in the react codebase. 1 imports, 0 dependents.

File tsx TestingUtilities Fixtures 1 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  3edc0944_d6de_1750_29a6_9a46ed116226["hook-call-freezes-captured-memberexpr.tsx"]
  006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"]
  3edc0944_d6de_1750_29a6_9a46ed116226 --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05
  style 3edc0944_d6de_1750_29a6_9a46ed116226 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import {useIdentity, Stringify, identity} from 'shared-runtime';

function Foo({val1}) {
  // `x={inner: val1}` should be able to be memoized
  const x = {inner: val1};

  // Any references to `x` after this hook call should be read-only
  const cb = useIdentity(() => x.inner);

  // With enableTransitivelyFreezeFunctionExpressions, it's invalid
  // to write to `x` after it's been frozen.
  // TODO: runtime validation for DX
  const copy = identity(x);
  return <Stringify copy={copy} cb={cb} shouldInvokeFns={true} />;
}

export const FIXTURE_ENTRYPOINT = {
  fn: Foo,
  params: [{val1: 1}],
  sequentialRenders: [{val1: 1}, {val1: 1}],
};

Subdomains

Functions

Dependencies

  • shared-runtime

Frequently Asked Questions

What does hook-call-freezes-captured-memberexpr.tsx do?
hook-call-freezes-captured-memberexpr.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 hook-call-freezes-captured-memberexpr.tsx?
hook-call-freezes-captured-memberexpr.tsx defines 1 function(s): Foo.
What does hook-call-freezes-captured-memberexpr.tsx depend on?
hook-call-freezes-captured-memberexpr.tsx imports 1 module(s): shared-runtime.
Where is hook-call-freezes-captured-memberexpr.tsx in the architecture?
hook-call-freezes-captured-memberexpr.tsx is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hook-call-freezes-captured-memberexpr.tsx (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