Perke
Perke2y ago

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 }];
const initialState = {
usersList: [
{
id: "",
asks: {
id: "",
name: "",
price: null,
},
},
],
};

state.usersList = [...state.usersList, { id: uid }];
whats the problem?
2 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
reactibot
reactibot2y ago
This thread hasn’t had any activity in 12 hours, so it’s now locked. Threads are closed automatically after 12 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/1035874277049770014