Intermediate
React
Learn React from zero. Components, state, hooks, context, performance, routing, testing, and a capstone app.
17 lessons10.2h hands-on11 languages
17 lessons, in order
- 125 min
What is React?
Welcome. If you have never written a line of JavaScript and you are not sure what a "framework" is, you are in the right place. By the end of this...
What React is, Components as functions, Virtual DOM intuition, Rendering JSX, Creating a Vite app
- 230 min
JSX and Components
In the last lesson you saw a component return something that looked like HTML: return <h1>Hello, React</h1>;. That should have felt slightly wrong....
JSX syntax rules, Single root element, className vs class, Embedding expressions with {}, Defining components, Composing components
- 330 min
Props
Every component you have written so far has been hardcoded. Greeting always says hello to the same name, Card always shows the same text. That is...
Passing props as attributes, Receiving props object, Destructuring props in signature, Default values, Thinking about prop shapes
- 435 min
State with useState
Every component you have written so far renders the same output for the same props, every single time. That is fine for a heading or a card, but it...
useState hook, Reading state, Calling the setter, Updater function form, Never mutate state, Counter pattern
- 530 min
Handling Events
A component that only ever renders based on props and state is not interactive on its own, something has to notice when the user clicks a button,...
onClick handler, onChange basics, Passing functions vs calling them, Event object, Passing handlers as props
- 630 min
Conditional Rendering and Lists
Almost every screen you have ever used shows one thing instead of another depending on some condition: a "you have new messages" banner that only...
&& for show/hide, Ternary for either/or, Mapping arrays to JSX, The key prop, Why keys need to be stable
- 735 min
Forms and Controlled Inputs
Type a letter into a plain HTML <input> and the browser just handles it: the DOM element quietly keeps track of what you typed, and nobody else needs...
Controlled input pattern, Value and onChange together, multi-field form state, onSubmit and preventDefault, Gathering form data
- 840 min
Effects with useEffect
A component's job, so far, has been to look at its current props and state and answer one question: what should be on screen right now. That answer...
What counts as a side effect, useEffect signature, Dependency array, Running on mount only, Cleanup function, subscribe/unsubscribe pattern
- 940 min
Data Fetching
Almost no real app can get by showing only data the user already has on their screen. At some point a component needs to ask a server for something,...
fetch inside useEffect, loading/error/data states, AbortController cleanup, Preventing setState after unmount
- 1035 min
Component Composition
You have built a card with a border and a shadow, and it looks good. Now you need the same card around a photo, and around a login form, and around a...
Children prop, Wrapping components, Passing JSX as props, Lifting state up, Thinking in component trees
- 1135 min
Context and useContext
Your app has a dark mode toggle. The toggle lives in the settings panel, but the thing that needs to know about it is a button eight components deep...
createContext, Context.Provider, useContext, When context is the right tool, Context vs prop drilling tradeoffs
- 1235 min
useReducer
A checkout form starts simple. There is a value, so you add useState. Then it needs an error message, so that is another useState. Then a loading...
When to reach for useReducer, Reducer function shape, Action objects, Dispatch, Combining useReducer with useContext
- 1335 min
Custom Hooks
You wrote a drawer that opens and closes. Three useState lines and a handler that flips a boolean. Then the same thing for a dropdown, and again for...
Extracting stateful logic into a function, Use prefix convention, useToggle example, useLocalStorage example, Hooks rules
- 1435 min
Performance and Memoization
Your app has a table with two thousand rows and a search box above it. Every keystroke feels heavy: you type, and half a second later the letter...
React.memo for components, useMemo for expensive computations, useCallback for stable function references, When memoization is overkill, Measuring before optimizing
- 1540 min
Routing with React Router
Everything you have built so far lives at one address. There is a single page, and whatever you want the user to see, you show or hide with state....
Installing react-router-dom, BrowserRouter, Routes and Route, Link for navigation, useParams, useNavigate
- 1640 min
Testing React Components
You change one line in a shared component and then spend twenty minutes clicking around the app checking that nothing else broke. Next week you...
Vitest + React Testing Library setup, Render and screen, getByRole queries, userEvent for interactions, Writing one good button test
- 1760 min
Capstone: Todo App
Every lesson so far handed you one idea at a time with a small example around it. Real apps are not like that. In a real app the state, the list...
Combining state, lists, controlled inputs, Custom hook for localStorage persistence, Small routing setup, Putting it together
Learn React in your language
Every lesson and every tutor reply comes in your language. The AI tutor matches the language you ask in.
Where React comes next
The roadmaps that include this course, and a timed challenge to test it.