Training Grounds
Reducer Mutates Its Own StateBlack Belt
+50 Ki
Description

A todo list uses useReducer. Items can be marked as done by clicking a button next to each one. Clicking "Complete" on any item has no visible effect — the item never changes appearance.

Anomaly

Click Complete on any todo item — nothing changes. The button responds (no crash, no error) but the item's status never updates on screen.

Constraint
Fix only the TOGGLE case in the reducer — do not change the component JSX or the dispatch call
The fix must return a new state object with a new items array
Hint

When a reducer returns the same object reference it received, React sees no state change and skips the re-render — even if properties on that object were mutated.

Consult the SenseiOnly for those truly stuck · Flip to reveal

When a reducer returns the same object reference it received, React sees no state change and skips the re-render — even if properties on that object were mutated.

Loading editor…
Correct Solution
Loading...
Expected OutputGoal State
Your OutputLive