One button on a server page
After this film you canput 'use client' on the smallest interactive piece.
Exercise
Download the exercise (a zip). Unzip it, read exercise.md, then in exercise/ run npm install and node check.mjs. The checker runs a real build and says PASS or FAIL for each criterion.
Recall
Answer each one out loud before you open it.
What else goes to the browser when you write 'use client' at the top of a file?
Everything that file imports, which is why it goes on the button's own file.
How does the button know the price?
The page passes it as a prop: data crosses the client boundary through props.
Bob clicks before the JavaScript has run. Why does nothing happen?
The button is server-rendered HTML; the click works after hydration.