I have this set of data
this.state = {
weeks: [
{
weekNumber: 1,
weights: []
},
{
weekNumber: 2,
weights: []
}
]
}
What I want to do is create a new array and set it to 'weights'. I've checked other posts like this one: Set state of nested array
I assume I do something similar.
Edit: Also, say for instance I want to update each individual week's weights array, how would I go about doing that?