Redux is an amazing tool if you take the time to get to know it. One of the things about Redux that commonly trips people up is that reducers must be pure functions. The problem is that sometimes a reducer needs to make a complicated change to some input state, but you can’t just mutate the state argument without causing bugs.
Full article