Im importing update
from immutability helper here :)
this.state = {
a: {
b: [{ c: '', d: ''}, ...]
}
}
this.setState((prevState, props) => update(prevState, {
a: {
b: {
$apply: b => b.map((item, ii) => {
if(ii !== n) return item;
return {
...item,
c: 'new value'
}
})
}
}
}))