#Understanding server & client component
15 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
Thanks
This question has been marked as answered! If you have any other questions, feel free to create another post
[Click here](#1280012241931993258 message)
Btw the docs go into detail about this: https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#interleaving-server-and-client-components
well, I have a diferent view from @ripe quartz
in Next.js, if you use "use client" in a parent component, all child components will also be treated as client components. The "use client" directive indicates that the component should be rendered on the client side, and this behavior propagates down to its children.
This is not a matter of opinion. Children of client components can still be server components as they are prerendered on the server and slotted in afterwards. They don't miraculously become client components with their usual set of features just because a parent component is a client component, they are still server components after all.
here is the screenshot from docs.
This question has been marked as answered! If you have any other questions, feel free to create another post
[Click here](#1280012241931993258 message)
This question has been marked as answered! If you have any other questions, feel free to create another post
[Click here](#1280012241931993258 message)
Can read here for an explanation why children of client components can still be server components: https://nextjs-faq.com/client-components-wrapping-server-component-children#why
Only components imported into client components become client components.
This question has been marked as answered! If you have any other questions, feel free to create another post
[Click here](#1280012241931993258 message)
Btw you can only mark one message as solution so I remarked to the one most deserving