resolvedTheme can be `system`
See original GitHub issueI have noticed in testing that useTheme().resolvedTheme
can be system
. I think it’s only happening in the first render, but I haven’t tried making a minimal reproduction.
I am using next-themes@npm:0.0.13-beta.2 [9e7cc
] (via npm:beta [9e7cc
]) and not passing any options to <ThemeProvider>
.
Is this expected behavior?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Cristi on Twitter: "@raunofreiberg If you're using next-themes from ...
, make the setTheme(resolvedTheme === 'dark' ? 'light' : 'dark') - not on 'theme', because if the default system is dark it will...
Read more >[RESOLVED] Theme-Editor Error - Page 2 - General - Forums
Something is apparently amiss with your system - be it an update or something else installed along the way which may require a...
Read more >Step-By-Step Guide to Adding Dark Mode and Multiple ...
With themes, users can easily switch between light and dark modes, or change the color scheme of the app, depending on their preference....
Read more >Architect a Theming System — Component Themes with Sass
As you can see from the sample above, all of our colors are consumed from the resolved theme. We can now customize the...
Read more >[resolved] Theme: Clear, Text Formatting Of Description - Piwigo
Can someone help me with this, please? I am so far only a beginner with CSS Thanks for any support. Piwigo 11.2.0. Operating...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sweet, thanks! I wasn’t able to reproduce the issue on the first render, but I was able to reproduce the issue when doing
setTheme('system')
twice.@thien-do explained it in #34
I updated the logic in this commit: https://github.com/pacocoursey/next-themes/pull/30/commits/8ab93d96b771cd4a523688d2cc6abce2386dada3
Basically when setting theme to system, it wasn’t applying the resolved theme – that only happened by accident! This adds the check and actually makes it faster (previously there were two calls: one to update the DOM to system, then another to update the DOM to dark/light)
You rock @pacocoursey 🚀 it’s fixed!