Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Help Me Stop Theme Flashing In SolidStart - SolidJS
S
SolidJS
•
2y ago
•
22 replies
ChrisThornham
Help Me Stop Theme Flashing In SolidStart
I built a theme switcher using SolidStart
. It works great
, with one exception
. On page reload
, the theme flickers or flashes
.
It
's happening because I
'm using SSR mode
. As a result
, my
ThemeProvider
ThemeProvider
doesn
't load the theme until the page loads
.
I believe I need to check the theme on the server so I can set the theme before my page loads using something like
https://github.com/donavon/use-dark-mode/blob/develop/noflash.js.txt
.
Next
.js has the next
-themes package that does this for you
.
https://github.com/pacocoursey/next-themes
I
'm wondering how I can do this
? Can anyone point me in the right direction
? Or share some example code
?
I
've pasted my ThemeProvider code in the next post
:
GitHub
GitHub - pacocoursey/next-themes: Perfect Next.js dark mode in 2 li...
Perfect Next
.js dark mode in 2 lines of code
. Support System preference and any other theme with no flashing
- pacocoursey
/next
-themes
SolidJS
Join
Solid is a declarative reactive Javascript library for creating user interfaces.
12,274
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Help Me Understand SolidStart vs. Next.js Caching
S
SolidJS / support
2y ago
Websockets in SolidStart Example
S
SolidJS / support
2y ago
Session stores in SolidStart
S
SolidJS / support
2y ago