From 809399973b5aac8febc3fdc0b8d65ed6c4dc97b4 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Thu, 16 May 2024 17:08:53 +0200 Subject: [PATCH] prevent error with return on !window --- src/App.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/App.js b/src/App.js index 805e9b3..b25496a 100644 --- a/src/App.js +++ b/src/App.js @@ -22,6 +22,7 @@ function App() { const location = useLocation(); useEffect(() => { + if (!window) return; window.scrollTo(0, 0); }, [location]);