Logo
Explore Help
Register Sign In
valknar/supervisor-ui
1
0
Fork 0
You've already forked supervisor-ui
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
b252a0b3bf3bb7bb29e06d330edd5ac73772d97e
supervisor-ui/components/layout/AppLayout.tsx

14 lines
316 B
TypeScript
Raw Normal View History

fix: resolve ThemeProvider SSR issue causing 500 error The app was crashing with "useTheme must be used within ThemeProvider" error during server-side rendering. Changes: - Created AppLayout client component to wrap Navbar - Modified useTheme hook to return default values during SSR instead of throwing an error - Updated Navbar to safely handle theme context - Moved Navbar rendering into client-side only AppLayout This fixes the SSR hydration mismatch and allows the app to render correctly on both server and client. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 20:27:44 +01:00
'use client';
import { ReactNode } from 'react';
import { Navbar } from './Navbar';
export function AppLayout({ children }: { children: ReactNode }) {
return (
<div className="flex min-h-screen">
<Navbar />
<main className="flex-1 container mx-auto px-4 py-8">{children}</main>
</div>
);
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.3 Page: 21ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API