File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -283,7 +283,7 @@ export const start = () => {
283283 initReactScanOverlay ( ) ;
284284
285285 const overlayElement = document . createElement ( 'react-scan-overlay' ) as any ;
286- document . body . appendChild ( overlayElement ) ;
286+ document . documentElement . appendChild ( overlayElement ) ;
287287
288288 if ( options . showToolbar ) {
289289 createToolbar ( ) ;
Original file line number Diff line number Diff line change @@ -368,7 +368,7 @@ export const createToolbar = () => {
368368}
369369 ` ;
370370
371- document . head . appendChild ( styleElement ) ;
371+ if ( document . head ) document . head . appendChild ( styleElement ) ;
372372
373373 const inspectBtn = toolbar . querySelector < HTMLButtonElement > (
374374 `#${ INSPECT_TOGGLE_ID } ` ,
@@ -391,7 +391,7 @@ export const createToolbar = () => {
391391
392392 let isActive = ! ReactScanInternals . isPaused ;
393393
394- document . body . appendChild ( toolbar ) ;
394+ document . documentElement . appendChild ( toolbar ) ;
395395
396396 let initialX = 0 ;
397397 let initialY = 0 ;
@@ -613,7 +613,7 @@ export const createToolbar = () => {
613613 if ( existing ) existing . remove ( ) ;
614614
615615 if ( ! toolbar . parentElement ) {
616- document . body . appendChild ( toolbar ) ;
616+ document . documentElement . appendChild ( toolbar ) ;
617617 }
618618
619619 ReactScanInternals . inspectState = {
You can’t perform that action at this time.
0 commit comments