MCPcopy
hub / github.com/facebook/react / performFullCleanup

Function performFullCleanup

packages/react-devtools-extensions/src/main/index.js:441–469  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

439}
440
441function performFullCleanup() {
442 // Potentially, if react hasn't loaded yet and user closed the browser DevTools
443 clearReactPollingInstance();
444
445 if (
446 (componentsPortalContainer ||
447 profilerPortalContainer ||
448 suspensePortalContainer) &&
449 root
450 ) {
451 // This should also emit bridge.shutdown, but only if this root was mounted
452 flushSync(() => root.unmount());
453 } else {
454 bridge?.shutdown();
455 }
456
457 componentsPortalContainer = null;
458 profilerPortalContainer = null;
459 suspensePortalContainer = null;
460 root = null;
461
462 mostRecentOverrideTab = null;
463 store = null;
464 bridge = null;
465 render = null;
466
467 port?.disconnect();
468 port = null;
469}
470
471function connectExtensionPort() {
472 if (port) {

Callers

nothing calls this directly

Calls 3

flushSyncFunction · 0.85
disconnectMethod · 0.80

Tested by

no test coverage detected