Home / Function/ Component() — react Function Reference

Component() — react Function Reference

Architecture documentation for the Component() function in sequentially-constant-progagatable-if-test-conditions.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  d22bc487_d303_961e_a820_3f5e63e0b786["Component()"]
  a55faed1_93b4_6cab_1f1f_ad911926d276["sequentially-constant-progagatable-if-test-conditions.js"]
  d22bc487_d303_961e_a820_3f5e63e0b786 -->|defined in| a55faed1_93b4_6cab_1f1f_ad911926d276
  style d22bc487_d303_961e_a820_3f5e63e0b786 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/sequentially-constant-progagatable-if-test-conditions.js lines 1–34

function Component() {
  let a = 1;

  let b;
  if (a === 1) {
    b = true;
  } else {
    b = false;
  }

  let c;
  if (b) {
    c = 'hello';
  } else {
    c = null;
  }

  let d;
  if (c === 'hello') {
    d = 42.0;
  } else {
    d = 42.001;
  }

  let e;
  if (d === 42.0) {
    e = 'ok';
  } else {
    e = 'nope';
  }

  // should constant-propagate to "ok"
  return e;
}

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/sequentially-constant-progagatable-if-test-conditions.js.
Where is Component() defined?
Component() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/sequentially-constant-progagatable-if-test-conditions.js at line 1.

Analyze Your Own Codebase

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

Try Supermodel Free