What React really does when a component renders, when state changes and when an effect runs. Every lesson runs a real React component and shows its state, its renders and the page at each step.
React · beginner · 21 lessons · 2 h 29 min · free
What you'll learn
See that a component is a function React calls again on every render
Understand why state is a snapshot and when the screen actually changes
Update objects and arrays in state the right way
Know exactly when effects and their cleanups run
Share state with props, context, reducers and custom hooks
Before you start
Basic JavaScript
Lessons
Components and JSX
Functions that return JSX, props, children, conditions and lists.
JSX: Markup Inside JavaScript: A component is a function that returns JSX. See plain JavaScript values flow into the markup through curly braces.
Components and Props: Use one component twice with different props. Follow React as it calls the same function once for each use.
Composition with children: Whatever you put between a component's tags arrives as the children prop. Build a Card that can wrap any content.
Conditional Rendering: Show different things depending on state, with a ternary, with &&, and with an early return. Click Log in and watch the page change.
Rendering Lists with Keys: Filter an array, map it to <li> elements and give each one a key. Watch filter and map run once per item.
State and Events
useState, event handlers, state snapshots and updating objects and arrays.
useState: What Happens on a Click: Follow a counter button through its first render, a click, and the re-render that puts the new number on screen.
Handling Events: Pass a function to onClick and read the event React gives it. One handler serves two buttons.
State Is a Snapshot: Call setScore(score + 1) three times in one click. Why does the score only go up by one?
Update Functions: Pass setScore a function instead of a value, and three updates really add three.
Updating Objects in State: Make a new object with ...spread instead of changing the old one. The bug version shows why changing it in place leaves the screen stuck.
Updating Arrays in State: Add to and change a todo list without mutating it: [...array, item] to add, map to change one item.
Lifting State Up: Two panels that must change together share state kept in their parent. Opening one closes the other.
Forms and Controlled Inputs: Keep an input's text in state, enable the button only for a valid email, and handle the submit.
Effects and Refs
Running code after render, dependencies, cleanup, loading data and refs.
useEffect: Code That Runs After Render: Sync the browser tab title with a counter. See exactly when React runs an effect: after the page has been updated.
Effect Dependencies: An effect with [query] runs only when query changes. Type in the box, then change the theme, and compare.
Effect Cleanup: A clock starts a timer in an effect and stops it in the cleanup. Watch it tick, then hide the clock.
Loading Data in an Effect: Load a user when the component appears and again when the id changes, and ignore answers that arrive too late.
useReducer: State Logic in One Place: A cart whose changes all go through one reducer function. Dispatch actions and watch React run the reducer.
Custom Hooks: Wrap useState in your own useToggle hook and use it twice. Each call gets its own state.
Related courses
Advanced React: Rendering and Performance: Why components render, how React batches updates, where stale values come from, how keys decide identity, and when memo, useMemo and useCallback actually help. Every lesson runs a real React component step by step. (9 lessons, 1 h 5 min)