Returning the State from the Reducer

A reducer should never be allowed to alter the state of the app. We'll see the correct way to handle the state below.

When returning state from reducers, there’s something that may put you off at first.

However, if you already write good ReactJS code , then you should be familiar with this already:

You should not mutate the state received in your Reducer. Instead, you should always return a new copy of the state.

Technically, you should never do this:

Get hands-on with 1200+ tech skills courses.