5 hands-on exercises and 5 find-the-bug challenges for the How React Thinks lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Render a count from state and a button that increases it.
Give a child component a name prop and display it.
Give the child a function prop and call it from a button.
Show the word open or closed based on a boolean state.
Show double the count without storing a second state value.
A local variable resets on every render and never triggers one.
A prop is read-only; assigning to it changes nothing the parent knows about.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspaceA child cannot change a parent's value directly — it calls a function the parent gave it.
Both calls read the same count from this render, so the second overwrites the first.
Storing a value that can be computed lets the two disagree.