Skip to content
Inside a Developer's Head by Jesús Quintana, home

Build your own React

Rebuild React from scratch, one piece at a time: every concept on its own with a tiny example, then merged into a React that runs in the browser and grows with each module.

intermediate6 of 24 lessons1 h 4 minpublished

In this course I rebuild React from scratch: JSX, fibers, the reconciler, hooks, effects, context, events, lanes, the scheduler, Suspense and the React 19 APIs. By the end there is a small React, mini-react, that renders real components in the browser, and a DevTools panel that shows every piece of it at work.

It is for developers who use React every day and have never read its source. You know what useState and useEffect do; this course is about how they do it, and why the rules around them are what they are.

How the course is organised

I never build the whole thing at once. There are three kinds of lesson:

  • Isolated lessons teach one concept, alone, with a tiny example of its own. Anything the concept needs from the rest of React is faked by hand, so you can understand it without knowing what comes next.
  • Isolated merges combine two of those lessons into a small engine that still runs without React around it. There are two: the state engine and the priority loop.
  • Milestones take the previous milestone, plug in the new pieces and end with a React that runs in the browser and does strictly more than the one before. A milestone only writes glue; the ideas were already taught in the lessons that feed it.

Every module ends in a milestone. The first one paints a static tree, the next one updates it, then comes state, effects and context, then concurrent rendering, Suspense, and the React 19 APIs. The finale opens mini-react with its DevTools, where each panel maps back to a lesson.

Fourteen isolated lessons in a left column feed eight milestones that step down to the right. Elements and JSX, Fiber tree and DOM host lead to First paint; Keyed diff leads to Reconciler; Hooks list and Update queue merge into the State engine, which leads to Stateful React; Effects and refs, Context stack and DOM events lead to Sync React; Lanes and Scheduler merge into the Priority loop, which leads to Concurrent; Thenables leads to Suspense; Async actions leads to React 19; DevTools hook leads to mini-react with DevTools. Each milestone also builds on the one above it.
The course map: lessons on the left, runnable milestones on the right

Read the map top to bottom: that is the order of the lessons. The isolated lessons can be read in almost any order, but a milestone needs everything that points into it.

  • #react
  • #javascript
  • #internals

What's inside