I have an array of arrays which is kept on changing on different operations, and I need to update the same in the draft of immer as shown below (Using React with Redux and Immer).
return produce(state, draft => {
switch (action) {
case SCENERIO1:
.
.
Some Logic To generate updated Array
.
.
draft.someArrayofArrays = modifiedArrayOfArrays;
break;
}
}
}
My Scenario is, I have 100 items in someArrayofArrays of draft. I have new updated array modifiedArrayOfArrays which I want to reassign to draft.someArrayofArrays
. So, this reassigning of updated array slows down/crashes if the array size is around 100 or more.
Am I doing anything wrong, or how to update the draft if my whole array is changing on each operation?