
Building Custom Hooks in React
Building custom hooks in React explained with reusable stateful logic, naming rules, composition examples, and why hooks share logic rather than state.
Articles
The guides are the practical part of this archive: working explanations for a specific web development problem, written to show the decision as well as the answer. The subject varies, but the aim is consistent: enough context to use the technique sensibly rather than copy it blindly.

Building custom hooks in React explained with reusable stateful logic, naming rules, composition examples, and why hooks share logic rather than state.

Static site generators explained in plain English, including how they compare with SSR, ISR and modern framework rendering choices.

Compare static generation and server‑side rendering in Next.js through freshness, request‑time data, performance, SEO, operational cost, and page intent.

urllist.txt from sitemap.xmlUsing PHP it is quick and easy to automatically generate your urllist.txt sitemap from your sitemap.xml file (for example, using gatsby‑plugin‑sitemap).

The differences between throttling and debouncing in JavaScript, including practical TypeScript code examples. Optimise event handling and improve performance.

Measure element dimensions in JavaScript with clientWidth, offsetWidth, getBoundingClientRect(), innerWidth, outerWidth, and responsive layout cautions.


useReducer in ReactuseReducer in React explained clearly, including reducer functions, action objects, complex state updates, and when it is a better fit than useState.

Dynamic routes in Next.js explained with [slug] pages, route params, nested segments, and why file‑based dynamic routing simplifies content‑driven sites.

301 vs. 307 RedirectsCompare 301 and 307 redirects clearly, including permanence, browser behaviour, SEO impact, cache handling, temporary moves, and when each status code fits.

Math.random()JavaScript Math.random() explained beyond the basics, including pseudo‑random generation, browser history, ranges, array indexes, and randomness limits.

useRef in ReactUse useRef in React for DOM access, focus management, mutable values, previous values, integration work, and cases where refs should not replace state.

React Hooks, introduced in React 16.8, bring state and lifecycle features to functional components. Here, I explore how they work and why they matter.

forEach Does Not Wait for async CallbacksSee why forEach() ignores promises returned by async callbacks, then choose sequential for...of or concurrent Promise.all() with clear failure handling.

Class and functional components are key to React development. In this article I explore differences, advantages, and when to use each in modern React apps.

Discover advanced responsive web design techniques with CSS Grid, clamp(), container queries, and JS enhancements for performance‑optimised, adaptive sites.

_app and Custom _document in Next.jsCustom _app and _document in the Next.js Pages Router: shared layout, application setup and server‑rendered HTML, with historical Next.js 8 examples.

The JavaScript event loop manages asynchronous tasks in a single‑threaded environment. I explore how it works with the call stack, task queue, and microtasks.