Stage 3

Stage 3: Advanced

✅ Complete. Every part below has its full lesson (README.md), examples/, exercises.md and solutions/, and the examples and solutions were actually run — see each part's README for real, captured output and ../TOOLING.md for the verified toolchain.

Goal: Talk to a real API from a component, know when (and when not) to optimize for performance, contain failures gracefully, and prove all of it with a real test suite. Time: ~18 h of lessons + ~6 h project (~24 h total) at 1–1.5 hours a day · Level: Stage 2 done (effects, custom hooks, context, reducer)


Parts in this stage

Part Topic Learning outcomes Time
11 Fetching data Fetch from a real public API inside useEffect; model loading/error/empty/success as explicit state (not boolean soup); cancel an in-flight request on unmount/re-fetch with AbortController; know why this is taught by hand before any data-fetching library ~5 h
12 Performance: useMemo, useCallback, React.memo Use the React DevTools profiler to find an actually slow render before touching any memoization API; apply useMemo/useCallback/React.memo correctly; explain why memoizing everything is a common beginner mistake ~4 h
13 Error boundaries and code-splitting Write an error boundary that contains a crash instead of blanking the whole app; lazily load a route/component with React.lazy and Suspense; show a fallback while loading ~4 h
14 Testing React components Write Vitest unit tests for a reducer/hook in isolation; write Testing Library tests that query by role/text like a user would; simulate clicks/typing with user-event; test an async loading/error UI ~5 h

Prerequisites for this stage

Stage 3 project {#stage-3-project}

Book Finder — a search app against a free public API (Open Library's search API), chosen because it needs no API key for basic use (the project README pins the exact endpoint):

Acceptance sketch (the project README has the final checklist):

Next

Stage 4: Routing and application architecture

Search the guide