Passing Client Components into RSCs
We have a server component (ListPeople
) that fetches a list of Person
records on the server. We also have a client component (RenderPerson
) that would render a person record with some client-side interactivity. We import the latter and pass it to the server component:
<ListPeople Render={RenderPerson} />
You may pass these component imports via multiple RSC layers, allowing for higher-order components that can change final client behaviour based on passed arguments (props).
(Click on each to reveal age, client-side)
Sarah - 2?
Dani - 2?
Sam - 3?