Accessibility (a11y) by default with React and TypescriptAccessibility (a11y for short) is a major concern when creating modern websites. And for a very good reason. The internet is for everyone and we, as developers, need to make sure we build it that way! When it comes to React, most developers are well ...Nov 29, 2022·6 min read·81
How to build a React component that is both controlled and uncontrolled (with examples)Aug 1, 2022·5 min read·64
How to use a Button component as a link in ReactTo correctly use a Button component as a link in React, we need to override the underlying button HTML tag of the component and turn it into an anchor tag, while still keeping the component styles and behaviour intact. Let's explore in more detail. B...Jul 10, 2022·3 min read·42
How to use withRouter HOC in React Router v6 with TypescriptReact Router v6 has been around for a while now. React developers who are still using older versions of the library are probably aching to upgrade. And for a good reason. Among other improvements, React Router v6 has been built from the ground up usi...Jun 18, 2022·3 min read·103
Create a List component with keyboard navigation in ReactTake advantage of useEffect, useReducer and useKeyPress custom hook to build a keyboard-friendly React component.Sep 26, 2021·4 min read·3.1K
Image optimization for static NextJS sitesNextJS is a great tool for building React apps. It comes with a lot of flexibility and awesome features like static site generation (with next export) and image optimization (with the next/image component). But there is a problem. Currently, it ...Mar 13, 2021·3 min read·6.8K
Choosing between client-side rendering, server-side rendering and static site generation for React appsIn the beginning of every new React project, one question inevitably floats to the surface - should we use client-side rendering (CSR), server-side rendering (SSR) or generate a static site (SSG). It is a strategic decision which depends on several k...Jan 17, 2021·7 min read·793
What is the best way to loop over an array in JavaScript?There are so many different ways to loop over an array in JavaScript. Sometimes, it becomes genuinely difficult to know which method to choose for a particular use case. And even though a lot of these methods can be used interchangeably to "get the j...Nov 15, 2020·4 min read·1.1K