QuizNot attempted
Where to put "use client"
1–4 to choose, Enter to submit
Show answer & explanation
Correct answer:
- On the
LikeButtononly, rendered inside a Server Component card
- Everything under a
"use client"boundary ships JS and hydrates, so put the boundary at the leaf: the card stays a Server Component (zero JS) and renders theLikeButtonClient Component with serializable props. - Not on ProductCard: the whole static card would ship and hydrate for one button.
- Not on the page: even more of the tree becomes client JS.
- Not in layout.tsx: turns every page into a client bundle and loses most RSC benefits.