diff --git a/packages/react-devtools-extensions/src/main.js b/packages/react-devtools-extensions/src/main.js index fb920df93807e..0651734b5571a 100644 --- a/packages/react-devtools-extensions/src/main.js +++ b/packages/react-devtools-extensions/src/main.js @@ -355,11 +355,9 @@ function createPanelIfReactLoaded() { // 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. - flushSync(() => { - root.unmount(() => { - initBridgeAndStore(); - }); - }); + flushSync(() => root.unmount()); + + initBridgeAndStore(); }); }, );