Home / Function/ Component() — react Function Reference

Component() — react Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  9f1f9c3b_1e52_3c58_71fb_6566346c93e4["Component()"]
  5437ead3_1e9b_1fff_c387_161df72de661["repro-dont-memoize-array-with-capturing-map-after-hook.js"]
  9f1f9c3b_1e52_3c58_71fb_6566346c93e4 -->|defined in| 5437ead3_1e9b_1fff_c387_161df72de661
  style 9f1f9c3b_1e52_3c58_71fb_6566346c93e4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-dont-memoize-array-with-capturing-map-after-hook.js lines 4–20

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

Analyze Your Own Codebase

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

Try Supermodel Free