-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
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
Doesnt work correctly with NextJS #66
Comments
do you have a small app that I can try this out on? |
@donavon here you go |
const { value } = useDarkMode(false, {
classNameDark: 'dark',
});
// const [dark, setDark] = useState(value);
const dark = value; Also, in your implementation, the value returned from |
In const { toggle } = useDarkMode(); then {theme == 'dark' ? (
<i class="ri-sun-line ri-xl" onClick={toggle}></i>
) : (
<i class="ri-moon-line ri-xl" onClick={toggle}></i>
)} No lambda function needed for the |
I am trying to use this with Next JS in _app.js but it seems that despite SSR support, there is some issue. Mechanism:
No Error in console. It just doesn't change useDarkMode "value" prop no matter how many times i enable() or disable().
The text was updated successfully, but these errors were encountered: