Answer the question
In order to leave comments, you need to log in
How to add another object to an object in redux?
There is a common state, it has an object, let's say items
const state = {
a: "1",
b: "2",
items:{
item1: "Строка 1",
item2: "Строка 2",
item3: "Строка 3"
}
};
message:{
item5: "Строка 5",
item6: "Строка 6",
item7: "Строка 7"
}
case "SET_DATA": {
return {
...state,
items: {
...state.items,
...{action.payload.value}
},
};
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question