Common Beginner Mistakes with React • Josh W. Comeau
A couple years ago, I was teaching React at a local coding bootcamp, and I noticed that there were a handful of things that kept catching students off guard. People kept falling into the same pits! In this tutorial, we're going to explore 9 of the most common gotchas. You'll learn how to steer around them, and hopefully avoid a lot of frustration. In order to keep this blog post light and breezy, we won't dig too much into the reasons behind these gotchas. This is more of a quick reference. This article is written for developers that are familiar with the basics of React, but are still pretty early in their journey. Alright, let's start with one of the most pervasive gotchas. I've seen this one “in the wild” on a handful of production apps! Take a look at the following setup: Code Playground Our goal is to conditionally show a shopping list. If we have at least 1 item in the array, we should render a ShoppingList element. Otherwise, we shouldn't render anything. And yet, we wind up wit
Introduction A couple years ago, I was teaching React at a local coding bootcamp, and I noticed that there were a handful of things that kept catching students off guard. People kept falling into the same pits! In this tutorial, we're going to explore 9 of the most common gotchas. You'll learn how to steer around them, and hopefully avoid a lot of frustration. In order to keep this blog post light and breezy, we won't dig too much into the reasons behind these gotchas. This is more of a quick reference. Intended audience This article is written for developers that are familiar with the basics
related reading
- Why React Re-Renders • Josh W. Comeaujoshwcomeau.com
- Build your own Reactpomb.us
- You Might Not Need an Effect – Reactreact.dev
- Understanding useMemo and useCallback • Josh W. Comeaujoshwcomeau.com
- Making Sense of React Server Components • Josh W. Comeaujoshwcomeau.com
- Implementing React from scratchrob.directory
- Blogged Answers: A (Mostly) Complete Guide to React Rendering Behavior · Mark's Dev Blogblog.isquaredsoftware.com
- Tutorial: Tic-Tac-Toe – Reactreactjs.org
- Tao of React - Software Design, Architecture & Best Practices | Alex Kondovalexkondov.com
- ALL React Hooks Explained in 12 Minutesyoutube.com
- The Elements of UI Engineering — overreactedoverreacted.io
- RSC From Scratch. Part 1: Server Components · reactwg server-components · Discussion #5github.com