Home / Function/ Component() — react Function Reference

Component() — react Function Reference

Architecture documentation for the Component() function in mixedreadonly-mutating-map.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  4d835df2_dacb_ace0_0022_1f0e84a9a562["Component()"]
  081a4152_0641_908c_7b79_1753b589571f["mixedreadonly-mutating-map.js"]
  4d835df2_dacb_ace0_0022_1f0e84a9a562 -->|defined in| 081a4152_0641_908c_7b79_1753b589571f
  style 4d835df2_dacb_ace0_0022_1f0e84a9a562 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mixedreadonly-mutating-map.js lines 32–54

function Component({extraJsx}) {
  const x = makeArray();
  const items = useFragment();
  // This closure has the following effects that must be replayed:
  //   - MaybeFreeze / Capture of `items`
  //   - ConditionalMutate of x
  const jsx = items.a.map((item, i) => {
    arrayPush(x, 2);
    return <Stringify item={item} key={i} />;
  });
  const offset = jsx.length;
  for (let i = 0; i < extraJsx; i++) {
    jsx.push(<Stringify item={0} key={i + offset} />);
  }
  const count = jsx.length;
  identity(count);
  return (
    <>
      <Stringify x={x} count={count} />
      {jsx[0]}
    </>
  );
}

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/mixedreadonly-mutating-map.js.
Where is Component() defined?
Component() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mixedreadonly-mutating-map.js at line 32.

Analyze Your Own Codebase

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

Try Supermodel Free