Home / Function/ Component() — react Function Reference

Component() — react Function Reference

Architecture documentation for the Component() function in allow-mutating-ref-property-in-callback-passed-to-jsx-indirect.tsx from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  658456bb_cbbd_06d4_8cd1_e4d2a1082be4["Component()"]
  7befbecc_eb99_097b_a679_4dab66d926e3["allow-mutating-ref-property-in-callback-passed-to-jsx-indirect.tsx"]
  658456bb_cbbd_06d4_8cd1_e4d2a1082be4 -->|defined in| 7befbecc_eb99_097b_a679_4dab66d926e3
  style 658456bb_cbbd_06d4_8cd1_e4d2a1082be4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allow-mutating-ref-property-in-callback-passed-to-jsx-indirect.tsx lines 4–23

function Component() {
  const ref = useRef(null);

  const setRef = () => {
    if (ref.current !== null) {
      ref.current.value = '';
    }
  };

  const onClick = () => {
    setRef();
  };

  return (
    <>
      <input ref={ref} />
      <button onClick={onClick} />
    </>
  );
}

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/allow-mutating-ref-property-in-callback-passed-to-jsx-indirect.tsx.
Where is Component() defined?
Component() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allow-mutating-ref-property-in-callback-passed-to-jsx-indirect.tsx at line 4.

Analyze Your Own Codebase

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

Try Supermodel Free