Using Immer with React: a Simple Solutions for Immutable States

By Medium - 2021-02-24

Description

In React, using an Immutable state enables quick and cheap comparison of the state tree before and after a change. As a result, each component decides whether to re-rendered or not before performing…

Summary

  • Using Immer with React: What is Immer and How It Works Immer is a small library created to help developers with immutable state based on a copy-on-write mechanism, a technique used to implement a copy operation on modifiable resources.
  • You might get the feeling that Immer is complicating your code if you are working with simple states.
  • But, Immer becomes very useful when it comes to handling more complex data.

 

Topics

  1. Frontend (0.47)
  2. Backend (0.1)
  3. UX (0.09)

Similar Articles

sudheerj/reactjs-interview-questions

By GitHub - 2021-01-12

List of top 500 ReactJS Interview Questions & Answers....Coding exercise questions are coming soon!! - sudheerj/reactjs-interview-questions

React Hooks Cheatsheet: The 7 Hooks You Need To Know

By freeCodeCamp.org - 2021-02-08

This new tutorial will show you everything you need to know about React Hooks from scratch. I've put this cheatsheet together to help you become knowledgeable and effective with React Hooks as quickly ...

When a simple React context gets out of hand.

By DEV Community - 2021-01-28

It seemed like a good idea to start. Separate state into different "contexts". Just use `useState`. Then, `useEffect` and multiple if branches snuck in and it became a nightmare.