I want to edit the label property but when I try to do it with this this.setState({chartData.datasets[0].label: 'Test'}) it throws me this error: Parsing error: Unexpected token, expected ","
state = {
chartData: {
labels: ['monday', 'tuesday', 'wednesday'],
datasets: [
{
label: '',
data: [40, 32, 70],
backgroundColor: [
'rgba(75, 192, 192, 0.6)'
],
borderWidth: 4
}
]
}
}
async componentDidMount() {
this.getDataSet();
}
getDataSet = async () => {
const res = await axios.get("https://covid.ourworldindata.org/data/ecdc/total_cases.csv");
const dataSet = res.data;
this.setState({chartData.datasets[0].label: 'Test'})
}