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
  5d3ae537_aedc_b83c_5a46_963da38ea815["Component()"]
  94cac37c_7cbc_f690_6709_e803572a63f9["ComponentUsingHooksIndirectly.js"]
  5d3ae537_aedc_b83c_5a46_963da38ea815 -->|defined in| 94cac37c_7cbc_f690_6709_e803572a63f9
  996a9ff5_439d_1dfd_b98c_e50d4ae90ec5["useIsDarkMode()"]
  5d3ae537_aedc_b83c_5a46_963da38ea815 -->|calls| 996a9ff5_439d_1dfd_b98c_e50d4ae90ec5
  style 5d3ae537_aedc_b83c_5a46_963da38ea815 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

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