From b294c8ef72c775edefa19bfa10fdfd85acfb69af Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Wed, 28 Apr 2021 02:18:54 -0700 Subject: [PATCH] Proper fix. --- hooks/useTheme.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/useTheme.js b/hooks/useTheme.js index 1231e283..9807f866 100644 --- a/hooks/useTheme.js +++ b/hooks/useTheme.js @@ -6,7 +6,7 @@ import { useEffect } from 'react'; export default function useTheme() { const defaultTheme = - typeof window !== undefined + typeof window !== 'undefined' ? window?.matchMedia('prefers-color-scheme: dark')?.matches ? 'dark' : 'light'