Hello. First of all thanks for your hard work that you put on this library.
My problem is that if I use extraReducers option in createSlice method from @reduxjs/toolkit and wrap the reducer using persistReducer I get this error message from immer:
An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft
Hello. First of all thanks for your hard work that you put on this library.
My problem is that if I use
extraReducers
option increateSlice
method from@reduxjs/toolkit
and wrap the reducer usingpersistReducer
I get this error message from immer:An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft
This is my slice:
If I don't wrap my reducer in
persistReducer
the error will go away.I tried returning a new state instead of mutating the state in
extraReducers
but it didn't work