• React Digest
  • Posts
  • React key attribute: best practices for performant lists

React key attribute: best practices for performant lists

#356 – May 16, 2022

sponsor

Do you have a side project that needs custom login & registration, Multi-factor authentication, Social Logins, or User Management? Download FusionAuth Community Edition for free! The best part is you get unlimited users and there's no credit card or subscription required.

this week's favorite

React “key” attribute is probably one of the most “autopilot” used features in React 😅 Who among us honestly can say that they use it because of “…some valid reasons”, rather than “because eslint rule complained at me”. And I suspect most people when faced with the question “why does React need “key” attribute” will answer something like “errr… we’re supposed to put unique values there so that React can recognise list items, it’s better for performance”. And technically this answer is correct. Sometimes.

At one point I found myself in a conversation between a React core maintainer, the inventor of XState, creator of React Router and Remix, a Chrome engine person, and the dude who built Firefox devtools and founded Replay.

It can be difficult to create a consistent and understandable folder structure when working with, or setting up, a vanilla React or Create React App project.

Forms are a huge part of the web. Literally every interaction the user takes to make changes to backend data should use a form. Some forms are pretty simple, but in a real world scenario they get complicated quickly. You need to submit the form data the user entered, respond to server errors, validate the user input as they're typing (but not before they've blurred the input please), and sometimes you even need to build custom-made UI elements for form input types that aren't supported (styleable selects, date pickers, etc.).

In this article, we'll build a Google Docs clone using React, Material UI, and Firebase.

courses

As a developer building a user-oriented application, it is imperative to secure the app’s user information and other sensitive server information. Explore some security challenges that React Native developers encounter when developing mobile apps, like secure data transfer, authentication protocols, and dependency vulnerabilities.

books

This ebook is meant to be a step-by-step guide for you to learn how to use some of the most in-demand IaC tools that exist: Terraform, Ansible, Puppet (and Puppet Bolt), Chef, and Salt. Each tool is covered as mostly a stand-alone-project that focuses on deploying a simple Docker-based Python web application from Github.

newsletters