You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When "setTheme" is called, "changeTheme" is always called
In "changeTheme", the data-theme attribute is set to the chosen theme, which is "system"
The "handleMediaQuery" effect is triggered due to "theme" changed, which set data-theme to the correct value (either "light" or "dark")
In the 2nd click of the button: step 1 and 2 are the same with the 1st click, but since the theme value (in state) is not changed (still "system"), the "handleMediaQuery" is not triggered, and thus the data-theme is not changed and is still "system" as in the 2nd step.
I reviewed the 0.13 PR and it seems this still happens
The text was updated successfully, but these errors were encountered:
What
setTheme("system")
Why
Current source: https://github.com/pacocoursey/next-themes/blob/7c8a3269ca46f2accad778f04820075134bc6c50/index.tsx
In the 1st click of the button:
In the 2nd click of the button: step 1 and 2 are the same with the 1st click, but since the theme value (in state) is not changed (still "system"), the "handleMediaQuery" is not triggered, and thus the data-theme is not changed and is still "system" as in the 2nd step.
I reviewed the 0.13 PR and it seems this still happens
The text was updated successfully, but these errors were encountered: