A chapter-by-chapter course
鈿涳笍 React Beginner Book
Learn React from zero, in plain language, following the structure of the official react.dev/learn docs. Every chapter has small examples you can type into your own project.
- Read the chapters in order. Each one builds on the one before. If your JavaScript is rusty, start with Appendix A: JavaScript Refresher.
- Type the examples yourself in
sample-test-react/src/App.jsx(runnpm run dev). Typing beats copy-pasting for learning. - Each chapter has a "More examples" section and 10 exercises (150 in total), labelled 馃煝 easy, 馃煛 medium or 馃敶 hard. Try each one before you open its solution.
- Each chapter ends with links to the matching official docs pages for deeper reading.
- Want more JavaScript practice? The 馃З Problem Set has 100 language-neutral problems with exact tests.
Part 1 路 Start here
Getting Started
What React is, creating a project with Vite, and how the files fit together.
Part 2 路 Describing the UI
Components & JSX
Your first component, import/export, JSX rules, and curly braces.
CHAPTER 3Props
Passing data from parent to child, defaults, and children.
CHAPTER 4Conditions & Lists
Showing UI only sometimes, and rendering arrays with map and key.
Pure Components & the UI Tree
Why components must be like math formulas, and how React sees your app.
Part 3 路 Adding Interactivity
Responding to Events
Click handlers, passing handlers as props, and event bubbling.
CHAPTER 7State & Rendering
useState, render & commit, snapshots, and queued updates.
Objects & Arrays in State
Updating without mutating, using spread and array methods.
Part 4 路 Managing State
Structuring & Sharing State
Thinking in states, avoiding redundant state, and lifting state up.
CHAPTER 10Preserving State & Reducers
When React keeps or resets state, and moving logic into useReducer.
Context
Passing data deeply without prop drilling, and combining context with a reducer.
Part 5 路 Escape Hatches
Refs
Remembering values without re-rendering, and reaching real DOM elements.
CHAPTER 13Effects
Syncing with the outside world, cleanup, dependencies, and when not to use effects.
CHAPTER 14Custom Hooks
Packaging reusable logic into your own useSomething functions.
Part 6 路 Putting it together
Appendix, Assessment & Practice
JavaScript Refresher
Destructuring, spread, map/filter/reduce, ?. and ??, modules, async/await: the ES6+ features React uses everywhere.
Test Your Knowledge
50 random questions from a pool of 1000, across every chapter. Multi-select answers, a score, and a per-chapter breakdown.
PRACTICE 路 ANY LANGUAGE馃З Problem Set
100 language-neutral problems (easy, medium, hard and OOP) with exact tests. Solve them in JavaScript to sharpen the language skills React relies on.
sample-test-react before starting this book.