Come back to this a few days after finishing the course. Remembering something after a gap is what makes it stick. Try everything here without looking back at earlier lessons first.
Bug hunt
This small app has four bugs. It doesn't even start: the preview is blank and the console says Too many re-renders. Find the bug that causes that first. Once the app runs, watch the page for a few seconds, click Add a note, and read the console. Then find the other three.
npm install and npm run dev. Hint 1: what to look for
- Too many re-renders means something sets state while the component is rendering, so every render asks for another one. Look for a function that is called in the JSX instead of passed.
- Once it runs: does the seconds counter keep going?
- Does clicking Add a note show a new note?
- What does React warn about in the console?
Hint 2: the days
Day 3 (events and state), Day 4 (keys and arrays) and Day 6 (effects and cleanup) each have at least one.
Show the four bugs and the fixed app
onClick={addNote()}callsaddNoteduring every render, instead of passing it for React to call on a click.addNotesets state, which asks for another render, which callsaddNoteagain, so React stops with Too many re-renders. Fix:onClick={addNote}. (Day 3)notes.push(...)thensetNotes(notes)changes the array in place and hands React the same array, so clicking shows nothing. Fix:setNotes([...notes, newNote]). (Day 4)- No
keyon the<li>elements, so React warns. Fix: a stable, unique key. (Day 4) - The interval reads a stale
secondsand has no cleanup.setSeconds(seconds + 1)always uses the first render's0, so the counter sticks at 1. Fix: an updater function, and return a cleanup that clears the interval. (Day 6)
npm install and npm run dev. Recall questions
Answer each in a sentence or two, then check against the lesson it came from.
- What does
root.render(<App />)do? (Day 1) - Why does
minutes="40"cause trouble when you add to it? (Day 2) - Why does
{count && <p>…</p>}sometimes show a 0? (Day 2) - Three calls to
setCount(count + 1)in one click add only 1. Why? (Day 3) - Why is
key={index}a problem in a list where items can be removed? (Day 4) - What are the two props of a controlled input? (Day 5)
- Where should state go when two siblings need it? (Day 5)
- When does React call an effect's cleanup function? (Day 6)
- Why do Study Tasks' tests clear
localStoragebefore each test? (Day 7)
Ready for the next step?
You're ready to move on if you can, without help:
- build a component tree from a brief, with props and callbacks
- choose where each piece of state lives
- update arrays and objects in state without changing them in place
- load data in an effect, with loading and error states and a cleanup
- run a React project with Vite and test it with Vitest
If any of these feels shaky, redo that day's checkpoint from scratch. It's quicker than you'd expect the second time.
Completion is saved in this browser only. It does not measure mastery.