Skip to content

QuizNot attempted

Where to put "use client"

A product card is static except for a like button. Where should "use client" go?
1–4 to choose, Enter to submit
Show answer & explanation

Correct answer:

  • On the LikeButton only, 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 the LikeButton Client 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.