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
  7f021c42_c886_b4aa_b93d_ab9b88b59bd7["Foo()"]
  b2b95b6a_100a_436b_97dc_b1a6ab577b68["useCallback-reordering-deplist-controlflow.tsx"]
  7f021c42_c886_b4aa_b93d_ab9b88b59bd7 -->|defined in| b2b95b6a_100a_436b_97dc_b1a6ab577b68
  style 7f021c42_c886_b4aa_b93d_ab9b88b59bd7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/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/preserve-memo-validation/useCallback-reordering-deplist-controlflow.tsx.
Where is Foo() defined?
Foo() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/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