there is a state like this:
review: {
"amount": 217,
"snippets": [
{
"id": 0,
"flag": false
},
{
"id": 1,
"flag": false
},
...
]
}
Now if I only want to set the review.snippets[1].flag = true, what should write in the reducer? For example:
case SET_FLAG: return {
...state,
review: {
...state.review,
snippets: {
...state.review.snippets,
// don't know how to write here to express array
}
},
};