Stage 1
Stage 1: Foundation
✅ Complete. Every part below has its full lesson (
README.md),examples/,exercises.mdandsolutions/, and the examples and solutions were actually run — see each part's README for real, captured output and../TOOLING.mdfor the verified toolchain.
Goal: Go from "what is JSX" to building small, real, interactive UIs with components, state, lists, and forms — no network calls yet. Time: ~21 h of lessons + ~5 h project (~26 h total) at 1–1.5 hours a day · Level: comfortable with modern JS and HTML (see the roadmap's prerequisites), new to React
Parts in this stage
Do them in order. Each part builds on the ones before it.
| Part | Topic | Learning outcomes | Time |
|---|---|---|---|
| 1 | How React runs | Scaffold a project with Vite; explain JSX vs HTML; explain what a component is and why React re-renders; run the dev server and read an error overlay | ~3 h |
| 2 | Components, props and composition | Write function components; pass and type-check props by convention; compose components (children, slots); split a UI into components sensibly | ~4 h |
| 3 | State and events | Use useState correctly (including why direct mutation doesn't trigger a re-render); wire up click/change/submit handlers; understand batching at a beginner level |
~5 h |
| 4 | Rendering lists and conditionals | Render arrays with .map(); choose a stable key; show/hide UI with &&, ternaries, and early returns; avoid the common "0 renders as text" bug |
~4 h |
| 5 | Forms and controlled inputs | Build controlled <input>/<select>/<textarea>; handle onSubmit and preventDefault; show inline validation messages |
~5 h |
Prerequisites for this stage
- JavaScript ES6+ (destructuring, arrow functions, array methods, template literals) and basic HTML — see the roadmap's prerequisites for the full list
- A working Node.js + npm install (verified versions in
TOOLING.md) - Nothing from React itself — this stage starts from zero
Stage 1 project {#stage-1-project}
Menu Browser — a static-data restaurant/shop browser: a list of items (name, price in ₹, category, in-stock flag), a search box, a category filter, and an add-to-cart counter with a running total. All data is a local JS array — no fetch yet, so the project proves Parts 1–5 cleanly before Stage 2 adds effects.
Acceptance sketch (the project README has the final checklist):
- Renders a list of items from an array using
.map()with correct keys - Search box filters the visible list as you type
- Clicking "Add" updates a cart count and a running ₹ total via
useState - An "out of stock" item renders disabled and cannot be added
- At least one controlled form input (e.g. a quantity field) with basic validation