Home / Function/ Component() — react Function Reference

Component() — react Function Reference

Architecture documentation for the Component() function in multiple-calls-to-hoisted-callback-from-other-callback.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  09a10979_271f_0526_1d1a_f7fe99b617f8["Component()"]
  ebf06576_427f_0b9b_1469_61d13c1ce50b["multiple-calls-to-hoisted-callback-from-other-callback.js"]
  09a10979_271f_0526_1d1a_f7fe99b617f8 -->|defined in| ebf06576_427f_0b9b_1469_61d13c1ce50b
  style 09a10979_271f_0526_1d1a_f7fe99b617f8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/multiple-calls-to-hoisted-callback-from-other-callback.js lines 3–21

function Component(props) {
  const [_state, setState] = useState();
  const a = () => {
    return b();
  };
  const b = () => {
    return (
      <>
        <div onClick={() => onClick(true)}>a</div>
        <div onClick={() => onClick(false)}>b</div>
      </>
    );
  };
  const onClick = value => {
    setState(value);
  };

  return <div>{a()}</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/multiple-calls-to-hoisted-callback-from-other-callback.js.
Where is Component() defined?
Component() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/multiple-calls-to-hoisted-callback-from-other-callback.js at line 3.

Analyze Your Own Codebase

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

Try Supermodel Free