Answer the question
In order to leave comments, you need to log in
How to add a field in an object in a reducer?
The store has an array like this:
plans: [
[ {id: 1},{id: 2},{id: 3} ],
[ {id: 4},{id: 5},{id: 6} ],
[ {id: 7},{id: 8},{id: 9} ],
]
case "TEST":
console.log(action.someID) // 3
console.log(action.value) // "SomeValue"
return {
...state,
plans: ???
};
plans: [
[ {id: 1},{id: 2},{id: 3, value: "SomeValue"} ],
[ {id: 4},{id: 5},{id: 6} ],
[ {id: 7},{id: 8},{id: 9} ],
]
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