Answer the question
In order to leave comments, you need to log in
How to change the property of an object of this level in Redux?
There is a state with such nesting level
const state = {
a: "1",
b: "2",
items:{
item1: {
key1.1: 'value1.1'
key1.1: 'value1.2'
},
item2: {
key2.1: 'value2.1'
key2.1: 'value2.2'
},
}
};
case "CLEAR_PROJECT_ERRORS": {
const newState = state;
newState.items[action.payload.object][action.payload.name] = "";
console.log("%c%s", "color: yellow;", "object",
newState.items[action.payload.object][action.payload.object] = "");
return newState
}
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