Next.js Discord

Discord Forum

If Layout is Client Component, are all children clients?

Unanswered
Barbary Lion posted this in #help-forum
Open in Discord
Avatar
Barbary LionOP
If I have a dashboard layout that's 'use client' does that mean all children (and everything inside my dashboard that's wrapped by that layout is now client component ?)

6 Replies

Avatar
Masai Lion
you can not have a layout that use client
Avatar
joulev & fuma pray for Schneider
No
Only components imported to that layout become client components
The restriction only applies to the root layout. Other layouts can be client components just fine. Whether it is good practice is another matter
Avatar
Masai Lion
oh ok thanx
Avatar
Barbary LionOP
Ah ok thanks