Home / Function/ Component() — react Function Reference

Component() — react Function Reference

Architecture documentation for the Component() function in repro-memoize-array-with-immutable-map-after-hook.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  f7a1ebe2_64fa_4015_643c_a0c4a6326552["Component()"]
  894a4bab_14ea_c133_ee41_6553605d5924["repro-memoize-array-with-immutable-map-after-hook.js"]
  f7a1ebe2_64fa_4015_643c_a0c4a6326552 -->|defined in| 894a4bab_14ea_c133_ee41_6553605d5924
  style f7a1ebe2_64fa_4015_643c_a0c4a6326552 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-memoize-array-with-immutable-map-after-hook.js lines 3–16

function Component(props) {
  const x = [props.value];
  useEffect(() => {}, []);
  const onClick = () => {
    console.log(x.length);
  };
  return (
    <div onClick={onClick}>
      {x.map(item => {
        return <span key={item}>{item}</span>;
      })}
    </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-memoize-array-with-immutable-map-after-hook.js.
Where is Component() defined?
Component() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-memoize-array-with-immutable-map-after-hook.js at line 3.

Analyze Your Own Codebase

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

Try Supermodel Free