If you’ve worked with React, or frankly any JavaScript framework, you’ve probably come across the idea of keeping state “immutable”. In other words, when working with state, you want to avoid mutating the state object when modifying a particular value. Immutability is a core concept of both object-oriented and functional programming, so before I dive into the awesomeness of Immer, I just want to take a brief moment to expound upon what immutability is and why it’s important in the applications we build.

#immutability #immer #javascript #react #react-native

Use Immer to Manage Your Immutable React State
2.45 GEEK