Skip to content

Conversation

@Yeom-JinHo
Copy link
Contributor

Description

This PR fixes the hydration error that occurred in the ThemeSwitch component during SSR by ensuring consistent rendering between the server and client.

Changes

  • Hydration Fix: Added a mounted state to delay UI rendering until the client is ready.
  • Theme Logic: Replaced theme with resolvedTheme to correctly detect the applied theme (light / dark) even when system mode is active.

Motivation

To prevent SSR and CSR mismatches when using next-themes with system preference enabled, ensuring stable rendering and correct theme icon display.

@naymurdev naymurdev merged commit 55d9abd into ui-layouts:main Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants