How to Work With Redux State Correctly
We see some of the methods that we can use to copy data and thus avoid these possible unexpected value changes.
To avoid these unwanted effects on Redux’s state handling, we should create new objects instead of directly manipulating the state. When React-Redux projects are very large, traditionally managing the Redux State can be very laborious. To do this, Redux Toolkit comes to the rescue.
Primitive: String, Boolean, Number, BigInt, Null, Undefined, Symbol.
Non-Primitive: Object (array, functions) also called object references.
State (also called the state tree) is a broad term, but in the Redux API, it usually refers to the single state value that is managed by the store and returned by getState(). It represents the entire state of a Redux application, which is often a deeply nested object.
Redux Toolkit makes it easier to write good Redux applications and speeds up development, by baking in our recommended best practices, providing good default behaviors, catching mistakes, and allowing you to write simpler code. Redux Toolkit is beneficial to all Redux users regardless of skill level or experience.