Web Development
Frontend and full-stack web guides from client work: React and Next.js patterns, TypeScript that pays off, performance, and deployment.
React Portals Done Right (Modals, Tooltips, Popovers)
Position: fixed still loses to an ancestor's overflow and transform. Portals escape the stacking-context trap, and the work is in the details: focus, Escape, scroll lock, cleanup.
Don't Sync State with useEffect (Derived State Instead)
Duplicating props into state and resyncing them with effects is the most common React state bug factory. Derived values compute during render and can never drift.
Why React Composition Beats Inheritance Every Time
Class hierarchies broke against UI and React never brought them back. Children, slots, and render props cover every case inheritance promises, without the coupling.
React 19 Actions + FormData: Forms Without Controlled State
The controlled-input form pattern ships hundreds of re-renders per keystroke for no benefit. React 19 actions with FormData delete the state, the onChange, and the reset logic.
useTransition for Non-Blocking UIs (And When useDeferredValue Fits)
Typing lags, tabs freeze, filters choke on big lists. React's transitions let urgent updates jump the queue while expensive ones render in the background.
useRef vs useState in React: When to Use Each One
useRef vs useState explained simply: refs hold values without re-rendering, state triggers renders. Clear rules for when to use useRef and when state is the right choice.
5 Rules for Custom Hooks That Don't Break Later
Most custom hooks grow into unmaintainable soup: ten responsibilities, hidden dependencies, race conditions. Five rules keep hooks small, honest, and testable.
Suspense + Streaming: The Pattern You Should Already Be Using
Most slow Next.js pages are one slow query holding everything hostage. Suspense boundaries let fast content ship instantly while slow sections stream in.
Error Boundaries Are Not Optional in Production
One thrown error in one component unmounts your entire React tree by default. Error boundaries contain the blast radius, and most codebases never ship them.
Stop Using Controlled Inputs for Everything
Controlled inputs re-render your form on every keystroke and most forms never need it. Where uncontrolled inputs with refs and FormData are simpler, faster, and harder to break, and the three cases that genuinely require controlled state.
React 19 State Batching Changes How You Write Forms
Three setStates in a row have always been one render, but React 19 goes further: automatic batching in promises and native handlers, plus form actions that reset inputs without a single state variable.
Why Your React List Performance Is Bad (It's the Keys)
Array index keys silently corrupt list state: wrong inputs filled, wrong rows animated, wasted re-renders. Why React needs identity, not position, and the cases where index keys are actually fine.
useMemo and useCallback Are Slower Than You Think
Memoization has its own cost: dependency comparisons on every render, cached-value memory, and dependency arrays that lie. When wrapping everything in useMemo makes your app slower and the three cases that actually pay for themselves.
The useEffect Cleanup Function Is Almost Always Missing Something
Most cleanup functions stop at clearing a timeout. The bugs that reach production come from the cases nobody covers: aborted fetches, stale closure writes, listeners on changing deps, and StrictMode's double invoke.
Server Components Click When You Stop Thinking in APIs
React Server Components are not about performance tricks. They change where your data lives. The mental model that made them obvious, with patterns I use daily.
TypeScript Types Don't Exist at Runtime. Zod Fixes That.
Your API types are lies until you validate them. How I use Zod to make TypeScript types real, with schemas that generate the types instead of decorating them.
TypeScript Patterns I Actually Use in Production (Not the Fancy Stuff)
Most TypeScript tutorials teach fancy generics you never need. Here are the patterns I actually use: discriminated unions, branded types, narrowing, and exhaustive checks.
React Forms That Do Not Suck: React Hook Form Plus Zod Is the Stack I Use
Building React forms with useState is fine for two fields. It falls apart for real forms. React Hook Form + Zod is the stack I use for everything else.
It Is Time to Switch From Jest to Vitest, Here's Why and How
Jest has been the standard for a decade. Vitest is faster, has native ESM support, and integrates with Vite. Here's the migration I run on client projects.
Next.js App Router Streaming: Stop Blocking Your Page on Slow Queries
Most Next.js apps render everything or nothing. Slow database queries make the whole page wait. Streaming with Suspense changes that. Here's how to use it correctly.
Practical Web Accessibility: What to Actually Fix (and What to Ignore)
WCAG has 1,000 rules. 20 of them cover 80% of real issues. Here's the practical accessibility checklist I use for client projects, focused on impact over checkboxes.
TanStack Query Is the Last State Library Your React App Needs
Most React apps use Redux or Zustand for state that is not actually state, it is cached server data. TanStack Query handles that better. Here's how to use it.
Tailwind CSS v4 Migration: What Actually Breaks (and What Got Way Better)
Tailwind v4 is a rewrite, not an upgrade. The oxide engine is faster, the config is gone, and several v3 patterns stop working. Here's the migration guide I wish I had.
Next.js Server Actions Are Great (Until You Use Them Wrong)
Server Actions are not a replacement for API routes. They shine for form mutations but break down for webhooks, third-party callbacks, and public APIs. Here's when to use them.
Next.js Middleware for Auth, The Patterns That Actually Work
Next.js middleware is the worst-documented feature in the framework. Edge runtime limits, JWT verification gotchas, redirect loops. Here's the setup I ship.
Stop Using Context for Everything, When Zustand Wins in 2026
React Context is the default state tool for most teams. It's also the slowest for anything that updates often. Here's the actual decision framework.
CORS, The Mental Model They Never Taught You
CORS is the most copy-pasted topic in web dev. Everyone adds Access-Control-Allow-Origin: * until it works. Here's what's actually happening under the hood.
Next.js App Router Patterns That Actually Scale (After 3 Production Apps)
App Router shipped in 2023. Three years later, most teams still use it like Pages Router with extra folders. Here's what actually scales past the demo.
Stop Re-rendering Everything: A Practical Guide to React Performance
Most React performance advice is wrong. useMemo and useCallback won't fix your app. Here's what actually causes re-renders, and what to do about them.
How to Optimize Images for Web Performance, The Complete Guide
Images account for 50%+ of a webpage's weight. Fix your images and your site loads 2x faster. Here's everything that actually matters.
How I Deploy Next.js Apps on Vercel, The Complete Setup (Domain, SSL, Analytics)
Deploying to Vercel takes 2 minutes. Setting it up properly takes 30. Here's the 30-minute version, custom domain, SSL, analytics, preview deploys, and rollback.
How to Write Clean Code That Other Developers Won't Hate You For
Clean code isn't about patterns or architecture. It's about the next person who reads it, usually you, 6 months later.
Why Every Restaurant Needs a Website in 2026 (And Why Most Restaurant Sites Are Terrible)
70% of diners check a restaurant's website before visiting. Most restaurant sites look like they were built in 2005. Here's what yours actually needs.
Building an E-Commerce Site with Next.js and Stripe, The Parts Nobody Covers
Stripe's docs are great. The edge cases that break your checkout flow? Not documented. Real lessons from building an online store.