-
Notifications
You must be signed in to change notification settings - Fork 83
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
useAppColorScheme incorrect behaviour when used more than once #281
Comments
thanks for the report. just to double-check, are you sure it's not a memoization issue? |
See this quick repro example I just threw together. The hook inside the |
Really appreciate the repro, thanks. I turned that into a unit test and have what seems like a straightforward fix in #283. I need |
released in |
I just wanted to add that if you set your color scheme from a callback by calling I'm aware this is not a bug in the library but wanted to leave the message for others in case they faced the same issue. |
Just noticed that even since #266 and #271, the
useAppColorScheme
hook appears to misbehave.If you're using the hook in two different parts of your app, and use
toggleColorScheme
in one part, it doesn't update globally.I think the solution might be to remove useState from the hook?
The text was updated successfully, but these errors were encountered: