Home / Function/ Component() — react Function Reference

Component() — react Function Reference

Architecture documentation for the Component() function in repro-mutable-range-extending-into-ternary.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  ad8b2dc5_2bb6_1b24_7e89_b75c275c1344["Component()"]
  df78f3e0_553b_c230_0ac0_1f6f3d75bef1["repro-mutable-range-extending-into-ternary.js"]
  ad8b2dc5_2bb6_1b24_7e89_b75c275c1344 -->|defined in| df78f3e0_553b_c230_0ac0_1f6f3d75bef1
  style ad8b2dc5_2bb6_1b24_7e89_b75c275c1344 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-mutable-range-extending-into-ternary.js lines 3–15

function Component(props) {
  const items = props.items ? props.items.slice() : [];
  const [state] = useState('');
  return props.cond ? (
    <div>{state}</div>
  ) : (
    <div>
      {items.map(item => (
        <div key={item.id}>{item.name}</div>
      ))}
    </div>
  );
}

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/repro-mutable-range-extending-into-ternary.js.
Where is Component() defined?
Component() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-mutable-range-extending-into-ternary.js at line 3.

Analyze Your Own Codebase

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

Try Supermodel Free