Next.js Discord

Discord Forum

Children of disabled SSR Components

Answered
Brokenwind posted this in #help-forum
Open in Discord
Hello, I'm trying to disable ssr of my layout because I need it to be purely on the client.

export const DashboardLayout = dynamic(() => Promise.resolve(DashboardLayoutBase), {
  ssr: false,
});


So I'm disabling SSR like this.

My question is DashboardLayoutBase accepts children and since this is on the layout, my pages are RSC. Will ssr be disabled on the DashboardLayoutBase's children too even if it would accept client components down the line?
Answered by Dwarf Hotot
Yes everything will be dynamic loaded
View full answer

4 Replies

Dwarf Hotot
Yes everything will be dynamic loaded
Answer
Dwarf Hotot
But if you dynamic load the children then the code will be more optimized
@Dwarf Hotot But if you dynamic load the children then the code will be more optimized
Yeah just checked it and it was dynamically loaded
I was dynamically loading the sidebar because I want the local storage to be used to save the state, I guess cookies are the way to go