How can I setstate of value object inside datasets.I tried to set the state by below approach but got the error.
this.setState({ datasets: { ...this.state.datasets, value: labels} });
//code for state
this.state = {
labels: ['January', 'February', 'March',
'April', 'May'],
datasets: [
{
label: 'Rainfall',
backgroundColor: 'rgba(75,192,192,1)',
borderColor: 'rgba(0,0,0,1)',
borderWidth: 2,
value: [65, 59, 80, 81, 56],
}
]
}