
React: Functional, Class, and Pure Components
Compare React functional, class, and pure components, including reusable component design, presentation boundaries, legacy patterns, and when each fits.
Articles
React is a declarative and flexible JavaScript library used for building user interfaces and applications. Amongst many other things, it allows you to compose your application UIs from components and offers an accessible route into more complex programming on the front end.
Below you will find a subset of articles from my blog specifically about React. This is an area that I have worked with for many years, and have managed to write about quite a few times. There are forty collected together for you below.

Compare React functional, class, and pure components, including reusable component design, presentation boundaries, legacy patterns, and when each fits.

p Tags from Contentful List ItemsOne of the quirks of rendering Rich Text from Contentful is that list items come wrapped in paragraph <p> tags. Fortunately, this is a simple one to resolve.

Contentful rich text and Gatsby work well together until code snippets enter the picture. This guide shows how to render inline and block code cleanly.

gatsby‑image Even FurtherOptimise gatsby‑image further with sensible maxWidth, quality settings, native lazy loading, GraphQL image data, and avoiding oversized assets in Gatsby.

Render greater‑than and less‑than symbols in JSX safely, using strings or HTML entities while avoiding parser confusion and awkward React output.

Comment in JSX without breaking React parsing, including curly‑brace block comments, why HTML comments fail, and gotchas around rendered output clearly.

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

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

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

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.

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.

The React Context API explained with Provider and Consumer examples, prop drilling trade‑offs, shared app state, and when context is not the right answer.

JavaScript frameworks streamline development with reusable components, state management, and optimised rendering. Here, I compare React, Vue.js, and Angular.

Integrating CMSes with HTML, CSS, and JavaScript enables dynamic, flexible content management. Here, I explore best practices, performance tips, and SEO.

React error boundaries explained with fallback UI, componentDidCatch(), getDerivedStateFromError(), logging, placement strategy, and what they cannot catch.

React Portals explained with modals, overlays, and tooltips, including DOM placement, event bubbling, accessibility concerns, and when portals help.

React Fragments explained through empty tags, keyed fragments, semantic markup, unnecessary wrapper divs, grouped list output, and layout side effects.