From 5e068acf39b2648e782d183b2357e311fa754e57 Mon Sep 17 00:00:00 2001 From: Flavio Riper Date: Thu, 16 Nov 2023 08:32:14 -0300 Subject: [PATCH] fix: localStorage SSR check --- src/components/layout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/layout.tsx b/src/components/layout.tsx index 24d9e175..685998a2 100644 --- a/src/components/layout.tsx +++ b/src/components/layout.tsx @@ -4,7 +4,7 @@ import Footer from "./footer" import TakeATour from "./TakeATour" const Layout = ({headerTheme, showTour = false, children}: {headerTheme: "light"|"dark", showTour?: boolean, children: React.ReactNode|React.ReactNode[]}) => { - const [closeTour, setCloseTour] = React.useState(!!localStorage.getItem('@estuary/closeTour')) + const [closeTour, setCloseTour] = React.useState(typeof window !== 'undefined' && !!localStorage.getItem('@estuary/closeTour')) return (