5 hands-on exercises and 5 find-the-bug challenges for the useEffect Explained lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Set a message once, after the first render.
Use an effect to write to the document title, and show it.
Store a derived total in state from an effect.
Let an effect update a label whenever the count changes.
Use an effect to count the rendered items.
The effect body was never wrapped in useEffect.
The DOM is read during render, before the elements exist.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspaceThe effect stores a placeholder instead of the total.
The label never updates because the effect only runs once.
The effect writes the title but the display shows a placeholder.