From ebf0081cc112a273ec7551925d1c6612b3343b59 Mon Sep 17 00:00:00 2001 From: dakai Date: Tue, 18 Apr 2023 13:03:33 +0800 Subject: [PATCH] fix error: window not defined --- app/components/home.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/home.tsx b/app/components/home.tsx index 54dc61fb2..a4295e992 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -159,7 +159,7 @@ function _Home() { useSwitchTheme(); // the two useEffects are for enable animation of the sidebar collapse in mobile screen - const [width, setWidth] = useState(window.innerWidth); + const [width, setWidth] = useState(0); useEffect(() => { const handleResize = () => {