File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
packages/app/src/sandbox/eval/presets/create-react-app Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,16 @@ async function initializeReactDevTools() {
2727 ) ;
2828 // The dispatch needs to happen before initializing, so that the backend can already listen
2929 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+ }
3240 // Call this before importing React (or any other packages that might import React).
3341 initializeDevTools ( window ) ;
3442 activate ( window ) ;
You can’t perform that action at this time.
0 commit comments