Check out example codes for "Error: [Immer] An immer producer returned a new value *and* modified its draft. Either return a new value *or* modified". It will help you in understanding the concepts better.

Code Example 1

Immer library recommends the use of code block to insure consistency across 
large code-base
your reducer should be like this (use code block)

rootReducer: (state, action) => { state.id = action.payload.id }

Learn ReactJs, React Native from akashmittal.com