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
  44ef3b8b_13fa_4cd9_9d84_16acca8c84b1["Component()"]
  63d3a7b1_7bfc_d6c2_4e6f_55b39863e574["ComponentUsingHooksIndirectly.js"]
  44ef3b8b_13fa_4cd9_9d84_16acca8c84b1 -->|defined in| 63d3a7b1_7bfc_d6c2_4e6f_55b39863e574
  0a10ad25_7240_9f58_fbac_ab2f6fee5456["useIsDarkMode()"]
  44ef3b8b_13fa_4cd9_9d84_16acca8c84b1 -->|calls| 0a10ad25_7240_9f58_fbac_ab2f6fee5456
  style 44ef3b8b_13fa_4cd9_9d84_16acca8c84b1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-shared/src/hooks/__tests__/__source__/__compiled__/external/react-sources-extended/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__/external/react-sources-extended/ComponentUsingHooksIndirectly.js.
Where is Component() defined?
Component() is defined in packages/react-devtools-shared/src/hooks/__tests__/__source__/__compiled__/external/react-sources-extended/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