diff --git a/packages/views/src/components/theme-provider.tsx b/packages/views/src/components/theme-provider.tsx index cee2ebcd4..ab307d97c 100644 --- a/packages/views/src/components/theme-provider.tsx +++ b/packages/views/src/components/theme-provider.tsx @@ -29,9 +29,7 @@ export function ThemeProvider({ const getMediaQuery = () => window.matchMedia('(prefers-color-scheme: dark)') const [theme, setThemeState] = useState(() => (localStorage.getItem(storageKey) as Theme) || defaultTheme) - const [systemTheme, setSystemTheme] = useState<'dark' | 'light'>(() => - getMediaQuery().matches ? 'dark' : 'light' - ) + const [systemTheme, setSystemTheme] = useState<'dark' | 'light'>(() => (getMediaQuery().matches ? 'dark' : 'light')) useEffect(() => { const root = window.document.documentElement @@ -39,7 +37,7 @@ export function ThemeProvider({ const applyTheme = theme === 'system' ? systemTheme : theme root.classList.add(applyTheme) - }, [theme, systemTheme]) + }, [theme, systemTheme]) useEffect(() => { const updateSystemTheme = () => setSystemTheme(getMediaQuery().matches ? 'dark' : 'light')