#React
85 posts

State and useState
State as React's unit of re-render. The exact model of useState, functional updates, and patterns for updating object state.

The essence of JSX
What JSX is and how it turns into JavaScript function calls, and the rules around expressions, attributes, and children — all in one place.

TypeScript + React Setup
Vite + TypeScript setup, the key tsconfig options, and your first .tsx file. The foundation we build Part 3 of this book on.

Typing events and forms
ChangeEvent · FormEvent · KeyboardEvent and the types of input handlers, TypeScript patterns for controlled and uncontrolled forms, and the foundation for Chapter 27's Server Actions FormData.

Typing fetch and API responses
The flow for handling external data safely — fetch is unknown, and zod schemas validate and type in one place. Plus the meaning fetch takes in an RSC environment, bridging into Part 4.

Typing hooks — useState · useReducer · useRef
Type inference and when to be explicit with built-in hooks. The discriminated-union action with useReducer, the two flavors of useRef (DOM ref and value box), and React 19 ref-as-prop, all in one chapter.

Typing props and children
Patterns for defining prop types, the difference between ReactNode, ReactElement, and JSX.Element, when to reach for PropsWithChildren, and discriminated union props, all in one chapter.

useContext — when it fits and when it doesn't
The Context API that resolves prop drilling. Three-step usage, value-separation pattern, and the boundary against external state libraries.

useEffect — when to use it and when to avoid it
The definition of side effects, the dependency array, the role of cleanup, and the cases where useEffect should not be used — all in one chapter.

What React Is
We lay out what React is and why it was built, then look at why it remains (and how it remains) the frontend standard in 2026. The starting point of this book.

Why Next.js and Server Components
The limits of client-side React, the problems Server Components address, and the differences between CSR, SSR, and RSC. The pivot chapter of the whole book.
Docker in Practice #3: React/Next.js Build Containers — standalone and the NEXT_PUBLIC Place
Wrapping a Next.js app into a container. The deps → build → runner three-stage pattern with standalone output, the build-time-baking issue with NEXT_PUBLIC env vars, the static-export option, and hosting a Vite SPA with nginx.