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
  84fd2797_a9d8_3fd5_fae0_3b303646fc17["Component()"]
  17188b8b_1d44_d00f_521f_a5628c0ee431["ComponentUsingHooksIndirectly.js"]
  84fd2797_a9d8_3fd5_fae0_3b303646fc17 -->|defined in| 17188b8b_1d44_d00f_521f_a5628c0ee431
  5e978d8a_5f8f_d9c6_010e_46927158099b["useIsDarkMode()"]
  84fd2797_a9d8_3fd5_fae0_3b303646fc17 -->|calls| 5e978d8a_5f8f_d9c6_010e_46927158099b
  style 84fd2797_a9d8_3fd5_fae0_3b303646fc17 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

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