toggleAllClassList: (state, action) => {
let allClassListLocal = state.classList || [];
var isAllSelected = false;
allClassListLocal.forEach(function (item: any) {
item.LstParentInfo.forEach((subItem: any) => {
subItem.IsSelected = !subItem.IsSelected;
isAllSelected = subItem.IsSelected;
});
});
return {
...state,
classList: [...allClassListLocal],
isClassListSelected: isAllSelected,
isAllSelected: isAllSelected,
};
}
I am getting this error
[Immer] An immer producer returned a new value and modified react native
I am using redux tool kit and getting this error. Any pointers on why is that?