We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I setTheme toggle, LocalStorage successfully becomes dark. But when I refresh the page, it is reset to light
dark
light
<NextUIProvider> <ThemeProvider attribute="class"> {children} </ThemeProvider> </NextUIProvider>
'use client' import { useTheme } from 'next-themes' import { Switch } from '@nextui-org/react' import React from 'react' export function DarkMode() { const { setTheme, theme } = useTheme() return ( <Switch size="sm" aria-label="Dark Mode" defaultSelected={theme === 'dark'} onValueChange={(isSelected) => { setTheme(isSelected ? 'dark' : 'light') }} /> ) }
"next-themes": "^0.3.0",
Chrome
The text was updated successfully, but these errors were encountered:
Can help reproduce this so i can help or at least figure out the issue. You can share the repository if possible.
I suggest using a different storage key.
Sorry, something went wrong.
No branches or pull requests
What happened?
When I setTheme toggle, LocalStorage successfully becomes
dark
.But when I refresh the page, it is reset to
light
Version
"next-themes": "^0.3.0",
What browsers are you seeing the problem on?
Chrome
The text was updated successfully, but these errors were encountered: