5 hands-on exercises and 5 find-the-bug challenges for the Structuring State lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Compute the total from the items rather than keeping a second state.
Keep two related values in one state object.
Keep the selected id in state and look the item up.
Use a single status string rather than several booleans.
Filter the list for display without storing the filtered copy.
A stored total goes stale when the list changes.
Two booleans allow an impossible state; use one status.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspaceA stored copy of the selected item goes stale; store the id.
State copied from a prop ignores later prop values.
The filtered list is stored, so it never updates with the source.