Home / Function/ performInTabNavigationCleanup() — react Function Reference

performInTabNavigationCleanup() — react Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  09ba7690_2483_1286_ee45_064a9928f9c3["performInTabNavigationCleanup()"]
  b5e42467_7633_e234_1d51_a93bfc4818c7["index.js"]
  09ba7690_2483_1286_ee45_064a9928f9c3 -->|defined in| b5e42467_7633_e234_1d51_a93bfc4818c7
  1deb2dd9_3a8c_4458_b91c_e3bcc4cb7739["onNavigatedToOtherPage()"]
  1deb2dd9_3a8c_4458_b91c_e3bcc4cb7739 -->|calls| 09ba7690_2483_1286_ee45_064a9928f9c3
  eca1c06b_bfad_5fe4_dfa2_3a0c06ef23e6["clearReactPollingInstance()"]
  09ba7690_2483_1286_ee45_064a9928f9c3 -->|calls| eca1c06b_bfad_5fe4_dfa2_3a0c06ef23e6
  style 09ba7690_2483_1286_ee45_064a9928f9c3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-extensions/src/main/index.js lines 456–496

function performInTabNavigationCleanup() {
  // Potentially, if react hasn't loaded yet and user performs in-tab navigation
  clearReactPollingInstance();

  if (store !== null) {
    // Store profiling data, so it can be used later
    profilingData = store.profilerStore.profilingData;
  }

  // If panels were already created, and we have already mounted React root to display
  // tabs (Components or Profiler), we should unmount root first and render them again
  if (
    (componentsPortalContainer ||
      profilerPortalContainer ||
      suspensePortalContainer) &&
    root
  ) {
    // It's easiest to recreate the DevTools panel (to clean up potential stale state).
    // We can revisit this in the future as a small optimization.
    // This should also emit bridge.shutdown, but only if this root was mounted
    flushSync(() => root.unmount());
  } else {
    // In case Browser DevTools were opened, but user never pressed on extension panels
    // They were never mounted and there is nothing to unmount, but we need to emit shutdown event
    // because bridge was already created
    bridge?.shutdown();
  }

  // Do not nullify componentsPanelPortal and profilerPanelPortal on purpose,
  // They are not recreated when user does in-tab navigation, and they can only be accessed via
  // callback in onShown listener, which is called only when panel has been shown
  // This event won't be emitted again after in-tab navigation, if DevTools panel keeps being opened

  // Do not clean mostRecentOverrideTab on purpose, so we remember last opened
  // React DevTools tab, when user does in-tab navigation

  store = (null: $FlowFixMe);
  bridge = (null: $FlowFixMe);
  render = (null: $FlowFixMe);
  root = (null: $FlowFixMe);
}

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free