Next.js Discord

Discord Forum

Lag during theme change

Answered
Alvin Joy posted this in #help-forum
Open in Discord
Hi I feel a lag while using shadcn ui with next-themes to change the theme of the theme button. I'm using the same code as mentioned at: https://github.com/shadcn-ui/ui/blob/main/apps/www/components/mode-toggle.tsx#L21
Heres my git repo: https://github.com/alvinsjoy/PortfolioWebsite/blob/main/components/ThemeSwitcher.tsx#L23
The first video is from my website (https://www.alvinjoy.live) and the second is from https://ui.shadcn.com
Does anyone know why is this happening? Is something wrong with my configs?
Answered by fuma nama
it's not laggy for sure, if you just wanted to turn off the color transitions, disable it from the next themes provider (it provides a disable transition prop iirc)
View full answer

5 Replies

help? someone?
Transvaal lion
I just tried your site and I didn't experience any lag switching themes.

Could it be a browser extension on youur end?
it's not laggy for sure, if you just wanted to turn off the color transitions, disable it from the next themes provider (it provides a disable transition prop iirc)
Answer