Blog
Writing about building a client-side router from scratch.
Per-Route Error Boundaries and Prefetch on Hover
Two problems that show up once a router has real users hitting it: what happens when one route breaks, and what happens while a user is deciding whether to click. This post covers building per-route error boundaries with two separate error channels, and prefetch on hover that reuses the exact same loader pipeline instead of building a second one.
Layouts That Persist and Data That Arrives Before You Do
Continuing to build a client-side router from scratch. This post covers what happens after the basics: how nested routes keep your navbar mounted across navigations, why the Outlet pattern is just a context counter, and how data loaders flip fetch-on-render into render-as-you-fetch with parallel execution and race condition guards.
What Actually Happens When You Click a Link in React
I'm building a client-side router from scratch to understand what React Router and TanStack Router do under the hood. This post walks through what I've found so far: the History API that makes navigation work without reloads, why useState breaks in concurrent mode, how route patterns become regex, and the `useSyncExternalStore` hook that ties it all together.