Home / Function/ Foo() — react Function Reference

Foo() — react Function Reference

Architecture documentation for the Foo() function in useCallback-reordering-deplist-controlflow.tsx from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  c727c4de_9f74_c110_bf26_b85745d9ad58["Foo()"]
  9718f58d_625e_e369_1175_36ab2f6cc279["useCallback-reordering-deplist-controlflow.tsx"]
  c727c4de_9f74_c110_bf26_b85745d9ad58 -->|defined in| 9718f58d_625e_e369_1175_36ab2f6cc279
  style c727c4de_9f74_c110_bf26_b85745d9ad58 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-mutability/useCallback-reordering-deplist-controlflow.tsx lines 5–19

function Foo({arr1, arr2, foo}) {
  const x = [arr1];

  let y = [];

  const getVal1 = useCallback(() => {
    return {x: 2};
  }, []);

  const getVal2 = useCallback(() => {
    return [y];
  }, [foo ? (y = x.concat(arr2)) : y]);

  return <Stringify val1={getVal1} val2={getVal2} shouldInvokeFns={true} />;
}

Subdomains

Frequently Asked Questions

What does Foo() do?
Foo() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-mutability/useCallback-reordering-deplist-controlflow.tsx.
Where is Foo() defined?
Foo() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-mutability/useCallback-reordering-deplist-controlflow.tsx at line 5.

Analyze Your Own Codebase

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

Try Supermodel Free