Home / Function/ Component() — react Function Reference

Component() — react Function Reference

Architecture documentation for the Component() function in ComponentUsingHooksIndirectly.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  ccb0dd2e_72e6_b9e7_4521_fc1fee06607f["Component()"]
  5ce7e7b2_ba7a_8042_822e_2d04117c444b["ComponentUsingHooksIndirectly.js"]
  ccb0dd2e_72e6_b9e7_4521_fc1fee06607f -->|defined in| 5ce7e7b2_ba7a_8042_822e_2d04117c444b
  1503f5cf_d72f_1477_e6a7_b02790a1f7ee["useIsDarkMode()"]
  ccb0dd2e_72e6_b9e7_4521_fc1fee06607f -->|calls| 1503f5cf_d72f_1477_e6a7_b02790a1f7ee
  style ccb0dd2e_72e6_b9e7_4521_fc1fee06607f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-shared/src/hooks/__tests__/__source__/__compiled__/inline/react-sources-extended/index-map/ComponentUsingHooksIndirectly.js lines 16–47

function Component() {
  const countState = (0, _react.useState)(0);
  const count = countState[0];
  const setCount = countState[1];
  const darkMode = useIsDarkMode();
  const [isDarkMode] = darkMode;
  (0, _react.useEffect)(() => {// ...
  }, []);

  const handleClick = () => setCount(count + 1);

  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
    __source: {
      fileName: _jsxFileName,
      lineNumber: 28,
      columnNumber: 7
    }
  }, "Dark mode? ", isDarkMode), /*#__PURE__*/_react.default.createElement("div", {
    __source: {
      fileName: _jsxFileName,
      lineNumber: 29,
      columnNumber: 7
    }
  }, "Count: ", count), /*#__PURE__*/_react.default.createElement("button", {
    onClick: handleClick,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 30,
      columnNumber: 7
    }
  }, "Update count"));
}

Domain

Subdomains

Frequently Asked Questions

What does Component() do?
Component() is a function in the react codebase, defined in packages/react-devtools-shared/src/hooks/__tests__/__source__/__compiled__/inline/react-sources-extended/index-map/ComponentUsingHooksIndirectly.js.
Where is Component() defined?
Component() is defined in packages/react-devtools-shared/src/hooks/__tests__/__source__/__compiled__/inline/react-sources-extended/index-map/ComponentUsingHooksIndirectly.js at line 16.
What does Component() call?
Component() calls 1 function(s): useIsDarkMode.

Analyze Your Own Codebase

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

Try Supermodel Free