Home / Function/ createProfilerPanel() — react Function Reference

createProfilerPanel() — react Function Reference

Architecture documentation for the createProfilerPanel() function in index.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  b371137d_1853_8d32_ae95_4a51462cd828["createProfilerPanel()"]
  b5e42467_7633_e234_1d51_a93bfc4818c7["index.js"]
  b371137d_1853_8d32_ae95_4a51462cd828 -->|defined in| b5e42467_7633_e234_1d51_a93bfc4818c7
  fcc10411_2c67_c71c_4b48_a0e0e4d6e62b["mountReactDevTools()"]
  fcc10411_2c67_c71c_4b48_a0e0e4d6e62b -->|calls| b371137d_1853_8d32_ae95_4a51462cd828
  a17b972e_da5c_8363_37f8_381173484aff["ensureInitialHTMLIsCleared()"]
  b371137d_1853_8d32_ae95_4a51462cd828 -->|calls| a17b972e_da5c_8363_37f8_381173484aff
  style b371137d_1853_8d32_ae95_4a51462cd828 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-extensions/src/main/index.js lines 344–378

function createProfilerPanel() {
  if (profilerPortalContainer) {
    // Panel is created and user opened it at least once
    ensureInitialHTMLIsCleared(profilerPortalContainer);
    render('profiler');

    return;
  }

  if (profilerPanel) {
    // Panel is created, but wasn't opened yet, so no document is present for it
    return;
  }

  chrome.devtools.panels.create(
    __IS_CHROME__ || __IS_EDGE__ ? 'Profiler ⚛' : 'Profiler',
    __IS_EDGE__ ? 'icons/production.svg' : '',
    'panel.html',
    createdPanel => {
      profilerPanel = createdPanel;

      createdPanel.onShown.addListener(portal => {
        profilerPortalContainer = portal.container;
        if (profilerPortalContainer != null && render) {
          ensureInitialHTMLIsCleared(profilerPortalContainer);

          render('profiler');
          portal.injectStyles(cloneStyleTags);

          logEvent({event_name: 'selected-profiler-tab'});
        }
      });
    },
  );
}

Domain

Subdomains

Frequently Asked Questions

What does createProfilerPanel() do?
createProfilerPanel() is a function in the react codebase, defined in packages/react-devtools-extensions/src/main/index.js.
Where is createProfilerPanel() defined?
createProfilerPanel() is defined in packages/react-devtools-extensions/src/main/index.js at line 344.
What does createProfilerPanel() call?
createProfilerPanel() calls 1 function(s): ensureInitialHTMLIsCleared.
What calls createProfilerPanel()?
createProfilerPanel() is called by 1 function(s): mountReactDevTools.

Analyze Your Own Codebase

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

Try Supermodel Free