concurrent-react-explained.md
Concurrent React: Suspense, Transitions, and Time Slicing
How React 18 schedules updates, keeps the UI responsive during heavy renders, and what useTransition actually buys you.
- React
- Performance
- Frontend
React 18 didn't add features โ it added scheduling. The same components, but the renderer can pause, resume, and prioritize work. That's concurrent React.
The problem it solves
A large list re-render blocks the main thread. Input feels laggy. Animations stutter. Classic React was synchronous โ one update finished before the next started.
Concurrent mode lets React interrupt low-priority renders when something urgent arrives (a keystroke, a click).
Transitions
Mark updates as non-urgent:
const [isPending, startTransition] = useTransition();
const [filter, setFilter] = useState("");
function handleChange(e: React.ChangeEvent<HTMLInputElement>) {
setFilter(e.target.value); // urgent โ input stays snappy
startTransition(() => {
setResults(search(e.target.value)); // non-urgent โ can be interrupted
});
}isPending drives loading states without blocking typing.
Suspense for data
Suspense boundaries declare "show fallback until ready":
<Suspense fallback={<Skeleton />}>
<BlogPost slug={slug} />
</Suspense>With RSC and streaming, HTML arrives incrementally โ shell first, content when resolved.
Automatic batching
React 18 batches all state updates โ timeouts, promises, native events โ into one render. Fewer layout thrashes, fewer paint cycles.
Mental model
| API | Priority | Use when |
|---|---|---|
setState |
Urgent | Input, clicks |
startTransition |
Transition | Filtering, tab switches |
useDeferredValue |
Transition | Defer expensive derived data |
Suspense |
โ | Async component trees |
Takeaway
Concurrent React isn't about parallelism โ it's about interruption and prioritization. Your job: tell React what's urgent. React's job: keep the UI responsive while heavy work catches up.
Related
Continue reading
More notes on similar topics.
WebAssembly Beyond the Browser
May 12, 2025
From Figma's design engine to Cloudflare Workers โ why WASM is becoming the portable bytecode layer of the web stack.
- WebAssembly
- Systems
Lessons from building NPUI โ tokens, primitives, and the gap between Figma and production.
- Design Systems
- React
A living reference for writing posts โ thumbnails, code, tables, alerts, footnotes, images, audio, video, and YouTube embeds.
- Markdown
- Blog