Use Immerjs with useState hook in React to modify complex states and arrays.

useState + Immer

For simple state change operations, useState is an ideal choice. Anything to do with arrays and complex objects can be handled by useImmer.




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Create a Input Text with label in React Native with Styled Components

Laravel Routing Part 2

JavaScript Basic Concept on string :

React Hooks — First Impressions

Extend a object

React Hooks tutorials for beginners-7

Top 10 Incredible Websites Built With Angular Framework

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


More from Medium

Token based authentication with local storage in React js with UseContext and useState

Prefetching lazily loaded bundles in React

Using AbortController with Fetch API and ReactJS.

Lifecycle explained based on Class or Function type component in React.