Error: An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft
The issue is the use of an arrow function with no curly braces as the reducer, because that acts as an implicit return statement. So, you’re both mutating state.token, and returning the result of the assignment. Per the Immer docs on returning data, there’s a couple ways to fix this: Adding the void operator in … Read more