PerkeP
Reactiflux4y ago
1 reply
Perke

Perke – 11-14 Oct 29

im trying to update array with spread operator but it says
state.usersList is not iterable

const initialState = {
usersList: [
    {
      id: "",
      asks: {
        id: "",
        name: "",
        price: null,
      },
    },
  ],
};

 state.usersList = [...state.usersList, { id: uid }];

whats the problem?
Was this page helpful?