fix: load Sidebar with ssr:false — zero server-rendered content
The sidebar now uses next/dynamic with ssr:false, meaning it renders NOTHING in the server HTML. No DOM content = no possible flash of "Ci" or any text during SSR-to-hydration gap. The sidebar only mounts on the client where localStorage is immediately available, so collapsed state is correct from the very first render.
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
'use client'
|
||||
|
||||
import { useState, useCallback } from 'react'
|
||||
import Sidebar from './Sidebar'
|
||||
import dynamic from 'next/dynamic'
|
||||
import ContentHeader from './ContentHeader'
|
||||
|
||||
// Load sidebar only on the client — prevents any SSR flash of text/labels
|
||||
const Sidebar = dynamic(() => import('./Sidebar'), { ssr: false })
|
||||
|
||||
export default function DashboardShell({
|
||||
siteId,
|
||||
children,
|
||||
|
||||
Reference in New Issue
Block a user