This is the problem
I'm trying to update the state of this object called singleCarers
I have the index of the roster in the rosters array i need to update
but the The key monday: needs to be dynamic & the key start: & finish: also needs to dynamic
const indexOfRoster = index;
const dayOfRoster = day;
const { value, name } = e.target; // name represents either start: or finish: & value is the value of start or finish eg. name:value === start: "09:10"
{
"rosters": [
{
"schedule": {
"monday": {
"start": "",
"finish": "",
},
},
},
]
}