Like a Post
Write the code, see it run, pass the checks.
The problem
- easy
- Code
The Post component gets how many other people liked it in a likes prop (1 when it isn't given). Show a "Like" button and, separately, a line with the count: "1 like" for exactly one, otherwise "0 likes", "2 likes" and so on. Clicking Like adds your like to the count and presses the button (aria-pressed="true"); clicking it again takes your like back (aria-pressed="false").
Your code must pass
- It starts at 1 like, not pressed
- Clicking Like adds your like
- Clicking again takes it back
- <Post likes={0} /> shows "0 likes", then "1 like"