I need to update state of a specific object field. My state is using a dynamic key value (index
).
First I'm doing:
this.setState({
[index]: {
uploading: uploadInstance,
progress: 0
}
})
Now I need only to update the progress field. With my attempt the uploading
field gets lost:
this.setState({
[index]: {
progress: progress
}
})