diff --git a/components/toggle-theme.tsx b/components/toggle-theme.tsx index 55864df..3ecaba1 100644 --- a/components/toggle-theme.tsx +++ b/components/toggle-theme.tsx @@ -21,15 +21,18 @@ export function ModeToggle() { }, []) function toggleTheme() { + // Use resolvedTheme to get the actual theme value (light/dark), not 'system' const currentTheme = resolvedTheme || theme const newTheme = currentTheme === 'light' ? 'dark' : 'light' setTheme(newTheme) } // Use resolvedTheme to get the actual theme value (light/dark), not 'system' + // Wait for both mounted and resolvedTheme to be available const currentTheme = resolvedTheme || theme + const isReady = mounted && resolvedTheme !== undefined - if (!mounted) { + if (!isReady) { return (
= 20.0.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "15.5.2", - "@next/swc-darwin-x64": "15.5.2", - "@next/swc-linux-arm64-gnu": "15.5.2", - "@next/swc-linux-arm64-musl": "15.5.2", - "@next/swc-linux-x64-gnu": "15.5.2", - "@next/swc-linux-x64-musl": "15.5.2", - "@next/swc-win32-arm64-msvc": "15.5.2", - "@next/swc-win32-x64-msvc": "15.5.2", + "@next/swc-darwin-arm64": "15.5.7", + "@next/swc-darwin-x64": "15.5.7", + "@next/swc-linux-arm64-gnu": "15.5.7", + "@next/swc-linux-arm64-musl": "15.5.7", + "@next/swc-linux-x64-gnu": "15.5.7", + "@next/swc-linux-x64-musl": "15.5.7", + "@next/swc-win32-arm64-msvc": "15.5.7", + "@next/swc-win32-x64-msvc": "15.5.7", "sharp": "^0.34.3" }, "peerDependencies": { diff --git a/package.json b/package.json index 3dac660..d56d6bf 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-react": "^0.542.0", - "next": "15.5.2", + "next": "^15.5.9", "next-themes": "^0.4.6", "react": "19.1.0", "react-dom": "19.1.0",