Category "immer.js"

Type 'MyType' is not assignable to type 'WritableDraft<MyType>'

I use @reduxjs/toolkit and my state contains: allSlides: ISlide[]; When I try to change anything in allSlides like ex. setAllSlides(state, action: PayloadAction

How to update state ( initial State ) objects in reducer when using immer?

If have a state of objects payload: export const initialState = { payload: { firstName: 'Mick', lastName: 'Andri', phoneNumber: '

How can you replace entire state in Redux Toolkit reducer?

EDIT: The solution is to return state after I replace it completely (return state = {...action.payload})! But why? I don't need to return it when I replace th