In the immutable data paradigm, it is quite important that we don’t accidentally change the data somewhere. It would break the paradigm in ways that are very hard to debug. In this lesson we’ll discover how Immer can help us by automatically freezing all data that is produced.
Furthermore, when writing reducers by hand it is quite easy to accidentally create new state trees, where this wasn’t needed. We will discover how Immer avoids this problem.