2019-05-31
912
#react
Abishek Jakhar
2158
May 31, 2019 ⋅ 3 min read

Returning null from setState in React 16

Abishek Jakhar Designer, Developer & Gamer

Recent posts:

5 JavaScript Mapping APIs Compared

5 JavaScript mapping APIs compared

We explore and compare five of the most prominent JavaScript mapping APIs: Leaflet, Mapbox GL JS, OpenLayers, ArcGIS, and the Google Maps API.

Abiola Farounbi
Feb 9, 2024 ⋅ 7 min read
Building A Serverless Postgres-Powered GraphQL API With Neon Db, Prisma Orm, And Apollo Server

Building a serverless GraphQL API with NeonDB and Prisma

Combine NeonDB, Prisma ORM, and Apollo Server within a serverless architecture to achieve a fully functional and scalable GraphQL API.

Nitish Sharma
Feb 8, 2024 ⋅ 12 min read
Exploring Interaction To Next Paint, A New Core Web Vital

Exploring Interaction to Next Paint, a new Core Web Vital

Interaction to Next Paint was added to Google’s Core Web Vitals to provide a more comprehensive assessment of website interactivity.

Rahul Chhodde
Feb 7, 2024 ⋅ 6 min read
Starlight Vs. Docusaurus For Building Documentation

Starlight vs. Docusaurus for building documentation

Explore Docusaurus and Starlight for building and customizing documentation websites, comparing their features such as sidebars, light/dark mode, and tabs.

Kapeel Kokane
Feb 6, 2024 ⋅ 10 min read
View all posts

3 Replies to "Returning null from setState in React 16"

  1. Point of clarification for someone relatively new to React: am I correct to say that it is not necessary to return null with setstate in the way described in this article when the [unchanging] state value(s) are members of a mapped list (where each member in the list has been assigned a unique key)? Or restated, is it the case that a mapped list, where each element in the list is assigned a unique key, only updates those elements where a state change has occurred, and so the technique explained by this article would not be necessary for unchanging elements of a mapped list even when other elements in the list undergo state changes?

    Great article, by the way. Everything makes sense. My question is mostly to make sure I have everything straight when it comes to state updates.

Leave a Reply