DEV Community

Discussion on: An Annotated Guide to React Server Components

Collapse
 
layzee profile image
Lars Gyrup Brink Nielsen

What do you think about Server Container Component wrapping Client-side Presentational Components?

Collapse
 
swyx profile image
swyx • Edited

let's not continue using that terminology. Dan has been distancing himself from it for 4 years and people keep repeating it like it is a necessary pattern in React. discuss this in 2020 terms - if you need the component to have state or effects, it should be a Client Component. If it doesn't, then you can make it a Server or Shared component.

When in doubt, make it a Client Component, that's what we've been doing all along anyway. Server Components are a purely optional addition.

Collapse
 
latviancoder profile image
Sergey Ryzhov

The props passed to client components need to be serializable though and most of the time containers are passing down callbacks which aren't serializable.

Collapse
 
layzee profile image
Lars Gyrup Brink Nielsen

How are we going to communicate up the component tree between client and server components?