Home / Function/ ReactiveRefInEffect() — react Function Reference

ReactiveRefInEffect() — react Function Reference

Architecture documentation for the ReactiveRefInEffect() function in reactive-setState.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  a97fe627_4070_5197_81a1_c3ff38075bdf["ReactiveRefInEffect()"]
  9a383401_9705_6926_497a_c9abf659d051["reactive-setState.js"]
  a97fe627_4070_5197_81a1_c3ff38075bdf -->|defined in| 9a383401_9705_6926_497a_c9abf659d051
  style a97fe627_4070_5197_81a1_c3ff38075bdf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-effect-dependencies/reactive-setState.js lines 8–18

function ReactiveRefInEffect(props) {
  const [_state1, setState1] = useRef('initial value');
  const [_state2, setState2] = useRef('initial value');
  let setState;
  if (props.foo) {
    setState = setState1;
  } else {
    setState = setState2;
  }
  useEffect(() => print(setState), AUTODEPS);
}

Subdomains

Frequently Asked Questions

What does ReactiveRefInEffect() do?
ReactiveRefInEffect() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-effect-dependencies/reactive-setState.js.
Where is ReactiveRefInEffect() defined?
ReactiveRefInEffect() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-effect-dependencies/reactive-setState.js at line 8.

Analyze Your Own Codebase

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

Try Supermodel Free