Home / File/ valid-setState-in-effect-from-ref-array-index.js — react Source File

valid-setState-in-effect-from-ref-array-index.js — react Source File

Architecture documentation for valid-setState-in-effect-from-ref-array-index.js, a javascript file in the react codebase. 1 imports, 0 dependents.

File javascript TestingUtilities Fixtures 1 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  85a0dd83_0bb4_eb89_e24a_f489c4b34ed4["valid-setState-in-effect-from-ref-array-index.js"]
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  85a0dd83_0bb4_eb89_e24a_f489c4b34ed4 --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  style 85a0dd83_0bb4_eb89_e24a_f489c4b34ed4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// @validateNoSetStateInEffects @enableAllowSetStateFromRefsInEffects @outputMode:"lint"
import {useState, useRef, useEffect} from 'react';

function Component() {
  const ref = useRef([1, 2, 3, 4, 5]);
  const [value, setValue] = useState(0);

  useEffect(() => {
    const index = 2;
    setValue(ref.current[index]);
  }, []);

  return value;
}

export const FIXTURE_ENTRYPOINT = {
  fn: Component,
  params: [],
};

Subdomains

Functions

Dependencies

  • react

Frequently Asked Questions

What does valid-setState-in-effect-from-ref-array-index.js do?
valid-setState-in-effect-from-ref-array-index.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 valid-setState-in-effect-from-ref-array-index.js?
valid-setState-in-effect-from-ref-array-index.js defines 1 function(s): Component.
What does valid-setState-in-effect-from-ref-array-index.js depend on?
valid-setState-in-effect-from-ref-array-index.js imports 1 module(s): react.
Where is valid-setState-in-effect-from-ref-array-index.js in the architecture?
valid-setState-in-effect-from-ref-array-index.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/valid-setState-in-effect-from-ref-array-index.js (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