File tree 1 file changed +3
-2
lines changed
packages/react-devtools-shared/src/devtools/views 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import '@reach/menu-button/styles.css';
13
13
import '@reach/tooltip/styles.css' ;
14
14
15
15
import * as React from 'react' ;
16
- import { useEffect , useMemo , useRef } from 'react' ;
16
+ import { useEffect , useLayoutEffect , useMemo , useRef } from 'react' ;
17
17
import Store from '../store' ;
18
18
import { BridgeContext , ContextMenuContext , StoreContext } from './context' ;
19
19
import Components from './Components/Components' ;
@@ -169,9 +169,10 @@ export default function DevTools({
169
169
} ;
170
170
} , [ showTabBar ] ) ;
171
171
172
- useEffect ( ( ) => {
172
+ useLayoutEffect ( ( ) => {
173
173
return ( ) => {
174
174
try {
175
+ // Shut the Bridge down synchronously (during unmount).
175
176
bridge . shutdown ( ) ;
176
177
} catch ( error ) {
177
178
// Attempting to use a disconnected port.
You can’t perform that action at this time.
0 commit comments