diff --git a/examples/web/react/components/display/display.tsx b/examples/web/react/components/display/display.tsx index 987921bc8c79f04a5ce42075741f512698f758bd..e5137bb2af290bf654c5d84fc6908a52c21f56b7 100644 --- a/examples/web/react/components/display/display.tsx +++ b/examples/web/react/components/display/display.tsx @@ -98,7 +98,8 @@ export const Display: FC<DisplayProps> = ({ // requests the browser to go fullscreen using the // body of the document as the entry HTML element nativeFullscreen && - document.body?.requestFullscreen().catch(() => {}); + document.body.requestFullscreen && + document.body.requestFullscreen().catch(() => {}); } else { setWidth(undefined); setHeight(undefined); @@ -109,7 +110,9 @@ export const Display: FC<DisplayProps> = ({ // restores the window mode, returning from the // fullscreen browser - nativeFullscreen && document?.exitFullscreen().catch(() => {}); + nativeFullscreen && + document.exitFullscreen && + document.exitFullscreen().catch(() => {}); } return () => { window.removeEventListener("resize", resizeRef.current);