Home / Function/ Foo() — react Function Reference

Foo() — react Function Reference

Architecture documentation for the Foo() function in infer-component-props-non-null.tsx from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  ee4903df_a144_0aa2_8f29_9f98617f715c["Foo()"]
  c820147f_471b_69a0_c5af_1fcd6805e77f["infer-component-props-non-null.tsx"]
  ee4903df_a144_0aa2_8f29_9f98617f715c -->|defined in| c820147f_471b_69a0_c5af_1fcd6805e77f
  style ee4903df_a144_0aa2_8f29_9f98617f715c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/propagate-scope-deps-hir-fork/infer-component-props-non-null.tsx lines 4–15

function Foo(props) {
  /**
   * props.value should be inferred as the dependency of this scope
   * since we know that props is safe to read from (i.e. non-null)
   * as it is arg[0] of a component function
   */
  const arr = [];
  if (props.cond) {
    arr.push(identity(props.value));
  }
  return <Stringify arr={arr} />;
}

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/propagate-scope-deps-hir-fork/infer-component-props-non-null.tsx.
Where is Foo() defined?
Foo() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/propagate-scope-deps-hir-fork/infer-component-props-non-null.tsx at line 4.

Analyze Your Own Codebase

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

Try Supermodel Free