Build a like button. When you press it, the like count goes up by 1 and the new number shows on screen right away. Complete LikeButton.
Build a React like button. When you press it, the like count goes up by 1 and the new number shows on screen right away. It all happens inside a single component with on-screen state — no server or global state.
A like button is the most basic interaction screen: a click changes a value, and the new value has to show on screen right away. In React, the number on screen and the value your code holds must stay in sync so each click redraws the latest count. What makes the behavior trustworthy is verifying not just one press but several, confirming the on-screen value stays correct.