File tree 1 file changed +10
-2
lines changed
packages/app/src/sandbox/eval/presets/create-react-app 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,16 @@ async function initializeReactDevTools() {
27
27
) ;
28
28
// The dispatch needs to happen before initializing, so that the backend can already listen
29
29
dispatch ( { type : 'activate-react-devtools' } ) ;
30
- // @ts -ignore We need to make sure that the existing chrome extension doesn't interfere
31
- delete window . __REACT_DEVTOOLS_GLOBAL_HOOK__ ;
30
+
31
+ // @ts -ignore
32
+ if ( typeof window . __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' ) {
33
+ try {
34
+ // @ts -ignore We need to make sure that the existing chrome extension doesn't interfere
35
+ delete window . __REACT_DEVTOOLS_GLOBAL_HOOK__ ;
36
+ } catch ( e ) {
37
+ /* ignore */
38
+ }
39
+ }
32
40
// Call this before importing React (or any other packages that might import React).
33
41
initializeDevTools ( window ) ;
34
42
activate ( window ) ;
You can’t perform that action at this time.
0 commit comments