Home / Function/ Component() — react Function Reference

Component() — react Function Reference

Architecture documentation for the Component() function in mutation-during-jsx-construction.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  d32481e0_8de2_3ad0_17fc_4d7f2c6474d6["Component()"]
  eda1aea9_1f1e_b182_ec4f_a2acf12c79d1["mutation-during-jsx-construction.js"]
  d32481e0_8de2_3ad0_17fc_4d7f2c6474d6 -->|defined in| eda1aea9_1f1e_b182_ec4f_a2acf12c79d1
  style d32481e0_8de2_3ad0_17fc_4d7f2c6474d6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutation-during-jsx-construction.js lines 3–11

function Component(props) {
  const key = {};
  // Key is modified by the function, but key itself is not frozen
  const element = <div key={mutateAndReturnNewValue(key)}>{props.value}</div>;
  // Key is later mutated here: this mutation must be grouped with the
  // jsx construction above
  mutate(key);
  return element;
}

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/mutation-during-jsx-construction.js.
Where is Component() defined?
Component() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutation-during-jsx-construction.js at line 3.

Analyze Your Own Codebase

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

Try Supermodel Free