shadcn / next-contentlayer

A template with Next.js 13 app dir, Contentlayer, Tailwind CSS and dark mode.
https://next-contentlayer.vercel.app
695 stars 94 forks source link

The mode toggle renders the incorrect icon on initial load #2

Closed devdutt10 closed 1 year ago

devdutt10 commented 1 year ago

When the app first launches, it uses the light theme but renders the sun icon. After it is toggled once, it renders the appropriate icon based on the current theme. This also results in a warning in the DevTools console.

Screenshot 2023-04-30 at 11 22 50 AM