DevLeonardoCommunity / github-stats

Aggregating and displaying YOUR GitHub Stats in meaningful metrics (we learn web development in the meantime)
https://public-github-stats.vercel.app
MIT License
71 stars 37 forks source link

fix: theme loading issue #84

Closed Balastrong closed 10 months ago

Balastrong commented 10 months ago

This pull request fixes an issue with the theme loading in the DarkModeDropdown component. Previously, the useEffect hook was used to set the document element based on the localStorage theme. However, this caused a flickering issue when the theme was changed. This PR removes the useEffect hook and instead sets the theme directly in the script tag in the Document component. This ensures that the theme is loaded earlier and avoids the flickering issue.

^ generated with copilot