
Stale Closures in React: Why Handlers, Effects, and Timers Read Old State
Stale closures in React explained through renders, handlers, effects, timers, refs, dependency arrays, why callbacks read old state, and how to fix them.
Articles
Front‑end development is where product intent becomes the interface people actually use. My writing approaches it as engineering rather than surface decoration, with attention to browser behaviour and code that remains accessible, fast, and safe for a team to change.

Stale closures in React explained through renders, handlers, effects, timers, refs, dependency arrays, why callbacks read old state, and how to fix them.

Debugging hydration mismatches in React and Next.js, including common causes, repeatable fixes, and how to stop server and client renders drifting apart.

AI search readiness starts with crawlable pages, rendered HTML, semantic structure, content quality, and safe action boundaries, not protocol‑first thinking.

Lessons from running Next.js Pages Router at scale in 2026, including governance, performance discipline, and why older patterns sometimes still make sense.

How to de‑risk a CMS migration before the real move starts, by testing workflows, content assumptions, integrations, ownership, and technical contracts early.

A practical framework for choosing rewrite, refactor, or strangler paths, based on risk, delivery pressure, change cost, and organisational appetite.

Diagnose Sass colours that survive compilation but break in Next.js production CSS when minification creates invalid mixed‑unit legacy rgb() values.

Mastering Server Components in Next.js, including client boundaries, data fetching, caching, streaming, and the mistakes that make App Router code messy.

Converting objects to query strings is essential for handling URLs in JavaScript. Here, I explore encoding, parsing, and managing query parameters in Next.js.

ETag and Last-ModifiedETag and Last-Modified drive conditional HTTP requests and 304 responses. See how precedence, weak validators, CDNs, and cache policy affect revalidation.

Best practices for managing environment variables in Next.js, so secrets stay server‑side and deployments do not freeze the wrong values at build time.

Approach production observability in Next.js with contextual logs, traces, release markers, client errors, cache signals, build visibility, and business data.


try, catch, and finallyGo beyond basic try/catch in JavaScript with finally, custom errors, async error handling, testing, user‑facing failures, and defensive‑code traps.

Slow Gatsby builds need a clear choice: optimise plugins, data, and images in place, or move to Next.js when publishing and cache limits justify it.

Audit third‑party script cost across GTM, consent tools, analytics, experimentation, and personalisation, without breaking measurement or business workflows.

A practical Gatsby to Next.js migration checklist covering routes, data, rendering, plugins, images, redirects, preview, sitemaps, and SEO validation.

A practical Contentful to Sanity migration checklist for Next.js sites, covering schemas, references, preview, redirects, metadata, and SEO checks.