Home / Function/ Component() — react Function Reference

Component() — react Function Reference

Architecture documentation for the Component() function in phi-type-inference-array-push-consecutive-phis.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  7a275095_5dcb_8a39_6e6b_5572abb5249f["Component()"]
  2847e515_67f5_2faa_c75d_6ed4f7ea0aff["phi-type-inference-array-push-consecutive-phis.js"]
  7a275095_5dcb_8a39_6e6b_5572abb5249f -->|defined in| 2847e515_67f5_2faa_c75d_6ed4f7ea0aff
  style 7a275095_5dcb_8a39_6e6b_5572abb5249f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/phi-type-inference-array-push-consecutive-phis.js lines 3–22

function Component(props) {
  const x = {};
  let y;
  if (props.cond) {
    if (props.cond2) {
      y = [props.value];
    } else {
      y = [props.value2];
    }
  } else {
    y = [];
  }
  // This should be inferred as `<store> y` s.t. `x` can still
  // be independently memoized. *But* this also must properly
  // extend the mutable range of the array literals in the
  // if/else branches
  y.push(x);

  return [x, y];
}

Subdomains

Frequently Asked Questions

What does Component() do?
Component() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/phi-type-inference-array-push-consecutive-phis.js.
Where is Component() defined?
Component() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/phi-type-inference-array-push-consecutive-phis.js at line 3.

Analyze Your Own Codebase

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

Try Supermodel Free