Home / Function/ Foo() — react Function Reference

Foo() — react Function Reference

Architecture documentation for the Foo() function in useCallback-captures-reassigned-context-property.tsx from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  c5f0f1f9_b097_8038_c932_ed4b9453260a["Foo()"]
  8721bfef_2521_f355_29aa_95d19f481330["useCallback-captures-reassigned-context-property.tsx"]
  c5f0f1f9_b097_8038_c932_ed4b9453260a -->|defined in| 8721bfef_2521_f355_29aa_95d19f481330
  style c5f0f1f9_b097_8038_c932_ed4b9453260a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-captures-reassigned-context-property.tsx lines 16–27

function Foo(props) {
  let contextVar;
  if (props.cond) {
    contextVar = {val: 2};
  } else {
    contextVar = {};
  }

  const cb = useCallback(() => [contextVar.val], [contextVar.val]);

  return <Stringify cb={cb} 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-captures-reassigned-context-property.tsx.
Where is Foo() defined?
Foo() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-captures-reassigned-context-property.tsx at line 16.

Analyze Your Own Codebase

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

Try Supermodel Free