Skip to content
Discussion options

You must be logged in to vote

I think the issue is in your commit code. You are assigning an array to a variable that has been made observable. So, you cannot replace it.

Change this line of code:

state.data1 = payload;

to:

state.data1.splice(0, state.data1.length, ...payload);

For this to work, your initial state needs to be like this:

const state = {
  data1:[],  // <-- replace the null with []
};

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@saifobeidat
Comment options

Answer selected by saifobeidat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants