Home / File/ reactive-ref.tsx — react Source File

reactive-ref.tsx — react Source File

Architecture documentation for reactive-ref.tsx, a tsx file in the react codebase. 2 imports, 0 dependents.

File tsx CompilerCore BabelIntegration 2 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  60bde164_8fb6_72ec_8b89_888954fcb99b["reactive-ref.tsx"]
  c745ba00_63aa_6e9b_0885_a745bade6cf7["react"]
  60bde164_8fb6_72ec_8b89_888954fcb99b --> c745ba00_63aa_6e9b_0885_a745bade6cf7
  9b88626e_0355_91af_db84_89f44a65ebc6["shared-runtime"]
  60bde164_8fb6_72ec_8b89_888954fcb99b --> 9b88626e_0355_91af_db84_89f44a65ebc6
  style 60bde164_8fb6_72ec_8b89_888954fcb99b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import {useRef} from 'react';
import {Stringify} from 'shared-runtime';

/**
 * Fixture showing that Ref types may be reactive.
 * We should always take a dependency on ref values (the outer box) as
 * they may be reactive. Pruning should be done in
 * `pruneNonReactiveDependencies`
 */
function Component({cond}) {
  const ref1 = useRef(1);
  const ref2 = useRef(2);
  const ref = cond ? ref1 : ref2;
  const cb = () => ref.current;
  return <Stringify cb={cb} shouldInvokeFns={true} />;
}

export const FIXTURE_ENTRYPOINT = {
  fn: Component,
  params: [{cond: true}],
  sequentialRenders: [{cond: true}, {cond: false}],
};

Domain

Subdomains

Functions

Dependencies

  • react
  • shared-runtime

Frequently Asked Questions

What does reactive-ref.tsx do?
reactive-ref.tsx is a source file in the react codebase, written in tsx. It belongs to the CompilerCore domain, BabelIntegration subdomain.
What functions are defined in reactive-ref.tsx?
reactive-ref.tsx defines 1 function(s): Component.
What does reactive-ref.tsx depend on?
reactive-ref.tsx imports 2 module(s): react, shared-runtime.
Where is reactive-ref.tsx in the architecture?
reactive-ref.tsx is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-ref.tsx (domain: CompilerCore, subdomain: BabelIntegration, 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