Compare commits
No commits in common. "51429045e66d42f51e986b8c67dd1be13a2c7a24" and "7750214c64c8b76e7eb54a4d110193082c22f424" have entirely different histories.
51429045e6
...
7750214c64
1 changed files with 0 additions and 5 deletions
|
|
@ -12,11 +12,6 @@ export function ThemeToggle() {
|
|||
|
||||
useEffect(() => {
|
||||
const stored = localStorage.getItem("sl-theme") as Theme | null;
|
||||
// localStorage is unavailable during SSR, so the stored theme can only be
|
||||
// read post-mount. ThemeScript already applies the `dark` class before
|
||||
// hydration (no page FOUC); only the toggle icon corrects on mount. The
|
||||
// rule is a false positive for this hydration-from-localStorage read.
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
if (stored) setTheme(stored);
|
||||
}, []);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue