5 hands-on exercises and 5 find-the-bug challenges for the Events and State Together lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Set a status from a click handler.
Let a child button update the parent's state.
Two children read the same value held by the parent.
Set the count back to its starting value.
Append to a list from a handler and show the count.
The child needs the callback passed down as a prop.
The value must live in the parent for both children to share it.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspaceThe reset handler increments rather than clearing.
The callback runs at render because it was called, not passed.
The handler replaces the list instead of appending to it.