Home / Function/ init() — react Function Reference

init() — react Function Reference

Architecture documentation for the init() function in devtools.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  5c29d355_c69e_7416_3f04_dbc1bcf01bec["init()"]
  845af5f3_68dc_5673_3728_e66cd88a1b6f["devtools.js"]
  5c29d355_c69e_7416_3f04_dbc1bcf01bec -->|defined in| 845af5f3_68dc_5673_3728_e66cd88a1b6f
  a9e5982a_a580_dfe5_4c03_8fd0ae7c065f["inject()"]
  5c29d355_c69e_7416_3f04_dbc1bcf01bec -->|calls| a9e5982a_a580_dfe5_4c03_8fd0ae7c065f
  style 5c29d355_c69e_7416_3f04_dbc1bcf01bec fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-shell/src/perf-regression/devtools.js lines 25–47

function init(
  appSource: string,
  appIframe: HTMLIFrameElement,
  devtoolsContainer: HTMLElement,
  loadDevToolsButton: HTMLButtonElement,
) {
  const {contentDocument, contentWindow} = appIframe;

  initializeBackend(contentWindow);

  inject(contentDocument, appSource);

  loadDevToolsButton.addEventListener('click', () => {
    const DevTools = createDevTools(contentWindow);
    createRoot(devtoolsContainer).render(
      <DevTools
        hookNamesModuleLoaderFunction={hookNamesModuleLoaderFunction}
        showTabBar={true}
      />,
    );
    activateBackend(contentWindow);
  });
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does init() do?
init() is a function in the react codebase, defined in packages/react-devtools-shell/src/perf-regression/devtools.js.
Where is init() defined?
init() is defined in packages/react-devtools-shell/src/perf-regression/devtools.js at line 25.
What does init() call?
init() calls 1 function(s): inject.

Analyze Your Own Codebase

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

Try Supermodel Free