Come back to this a few days after finishing the course. Try everything without looking back at earlier lessons first.
Bug hunt
This board has four bugs, from Days 1, 2 and 5. Try these, in order, and note what goes wrong each time:
- Clear the console, then type try quickly in the search box.
- Rename Read about reducers to Reducers! with the editor.
- Select Try context in the list.
- Remove a card with ×.
Runs with Vite on your computer: unzip, then
npm install and npm run dev. Hint 1: what you should have seen
- Three request lines, one per letter.
- The list says Reducers!, but the editor's heading still says Editing: Read about reducers.
- The heading changes to Try context, but the box still says Reducers!.
- The whole page disappears: Unknown action: card_removed.
Hint 2: where to look
The debounce hook's effect; the selected state; how Editor is rendered; and
the reducer's card_removed case.
Show the four bugs and the fixed app
- The debounce never cancels (Day 5). Each keystroke starts a timer, and
nothing clears the old ones. Return a cleanup:
const id = setTimeout(...); return () => clearTimeout(id);. - The selection is a copied card (Day 1). The reducer makes a new card
object when renaming; the copy in
selectedkeeps the old title. StoreselectedIdand look the card up during render. - The editor keeps its draft (Day 1). It stays in the same place, so its
state survives. Give it
key={selected.id}. - A case without
return(Day 2).card_removedfalls through todefaultand throws. Return the filtered cards. An error boundary would also have kept the rest of the page on screen.
Runs with Vite on your computer: unzip, then
npm install and npm run dev. Recall questions
Answer each in a sentence or two, then check the lesson it came from.
- What are the three questions that decide whether a value is state? (Day 1)
- How do you make a component's state start fresh when a prop changes? (Day 1)
- Why must a reducer be pure, and where does
Date.now()go instead? (Day 2) - Why put state and dispatch in separate contexts? (Day 3)
- When would you choose composition over context? (Day 3)
- Changing a ref doesn't re-render. When is that what you want? (Day 4)
- Name three things that look like they need an effect, but don't. (Day 5)
- Why does
memoneed stable props, and how do you keep a function stable? (Day 6) - Which errors can't an error boundary catch? (Day 7)
Ready for the next step?
You're ready to move on if you can, without help:
- choose minimal state, and say where each piece lives
- move a component's updates into a tested reducer
- share state through context with checked hooks
- extract logic into a custom hook, and tell when an effect isn't needed
- keep a slow screen responsive, and handle a form with actions
- test a reducer, a component and a hook with Vitest
If one of these feels shaky, redo that day's checkpoint from scratch.
Completion is saved in this browser only. It does not measure mastery.