fix: move DevToolbar dynamic import to Client Component
ssr: false is not allowed with next/dynamic in Server Components.
Extracted the dynamic() call into DevToolbarLoader.tsx ('use client')
so layout.tsx stays a pure Server Component.
This commit is contained in:
13
components/DevToolbarLoader.tsx
Normal file
13
components/DevToolbarLoader.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
'use client';
|
||||
|
||||
import dynamic from 'next/dynamic';
|
||||
|
||||
// ssr: false ist nur in Client Components erlaubt
|
||||
const DevToolbar = dynamic(
|
||||
() => import('@/components/DevToolbar').then(m => ({ default: m.DevToolbar })),
|
||||
{ ssr: false }
|
||||
);
|
||||
|
||||
export function DevToolbarLoader() {
|
||||
return <DevToolbar />;
|
||||
}
|
||||
Reference in New Issue
Block a user