Home / File/ reactive-ref-ternary.js — react Source File

reactive-ref-ternary.js — react Source File

Architecture documentation for reactive-ref-ternary.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
  fbf6307d_ed04_6506_5132_cee30af94797["reactive-ref-ternary.js"]
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  fbf6307d_ed04_6506_5132_cee30af94797 --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"]
  fbf6307d_ed04_6506_5132_cee30af94797 --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05
  style fbf6307d_ed04_6506_5132_cee30af94797 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// @inferEffectDependencies
import {useRef, useEffect, AUTODEPS} from 'react';
import {print, mutate} from 'shared-runtime';

function Component({cond}) {
  const arr = useRef([]);
  const other = useRef([]);
  // Although arr and other are both stable, derived is not
  const derived = cond ? arr : other;
  useEffect(() => {
    mutate(derived.current);
    print(derived.current);
  }, AUTODEPS);
  return arr;
}

Subdomains

Functions

Dependencies

  • react
  • shared-runtime

Frequently Asked Questions

What does reactive-ref-ternary.js do?
reactive-ref-ternary.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 reactive-ref-ternary.js?
reactive-ref-ternary.js defines 1 function(s): Component.
What does reactive-ref-ternary.js depend on?
reactive-ref-ternary.js imports 2 module(s): react, shared-runtime.
Where is reactive-ref-ternary.js in the architecture?
reactive-ref-ternary.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-effect-dependencies/reactive-ref-ternary.js (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-effect-dependencies).

Analyze Your Own Codebase

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

Try Supermodel Free