Passing a Client Component into another, from an RSC
Building on the previous pattern, Passing Client Components into RSCs: In addition to the server component (ListPeople
), we also have two components RenderPerson
and RenderAge
. Inside the RSC, we import both. We invoke the first and pass the second as a prop:
<RenderPerson RenderAge={RenderAge} />
(Click on each to reveal age, client-side)
Sarah - 2?
Dani - 2?
Sam - 3?