Writing about React, testing, and building better frontend software.

Practical articles on React, automated testing, component design, state, edge cases, and the process of making applications easier to change.

Testing and developing with React and TS: Data structures (part 1)

Learn about: testing, relying on TypeScript to improve correctness, and modeling data-structures while building a multilevel-list React component. In this part, we'll focus on modeling the underlying data structure to support the multilevel-list component.

How important is testing for a React developer?

A common question to have when we're starting to learn React is how important it is to know how to write automated tests. This article answers that question.

How to test a React application index.js

If you've started a project with Create React App, index.js will probably make your test coverage fail. Here's how to solve that.

How to get started testing React applications

If you don't have experience writing tests, getting started can be daunting. Especially if you're trying to test code that interacts with a framework/library like it is when you're testing a React application. In this article we'll go over the usual tools to test a React application, how to get unstuck when we don't know how to test a piece of code, and also a basic testing methodology that allows us to get started right away.

7 questions to find out corner cases when fetching data from an API in a React application.

Fetching data from APIs is something that almost all React applications do. However, this doesn't mean doing it correctly is simple. While it's easy to fetch data an show it on the screen, it's not trivial to get all the corner cases right. The first step to handle those corner cases is to be aware of them. So in this article, we'll go over questions we can make to help us find out corner cases when fetching data from an API.

How to implement infinite scroll using React, Hooks and Intersection Observers

When we want to add an infinite scroll to a React app, we can try to find a library that already does it for us, or we can implement our version from scratch. Since building things is one of the best ways to improve as a software developer, in this article, we'll go over how to develop an infinite scroll.

A common misconception with useMemo and useCallback

A common misconception with useMemo and useCallback is that they can be used to preserve the identity of values across React components renders. However, what they have been designed for, is performance optimization. And not being aware of the difference, may be a source of bugs.

4 resources to learn React under the hood

One of the best ways to improve as a developer is to understand how the tools we use work. If you've been working with React for a while, and you are pretty comfortable working with its API, it's time to find out it works under the hood. In this article you'll find a compilation of resources that will help you understand how React does what it does.

Understanding the value of software can help us code better

Decision-making is always present during software development. However, it's not always that clear which decision we should make. When in doubt, it's always useful to have in mind what will make our software valuable, so that with every decision we can take a step forward into that direction.

How to animate an image in React when it changes

Animating an image when it changes in React requires an understanding of how React works and what it does under the hood. In this blog post we'll explore a way to animate an image when it changes, while keeping in mind what is happening at a DOM level.

How to pass state between components

Sometimes the best approach to passing state between multiple components, is to not have multiple components at all.