I have an array like this: subzones:{name , [rows]} Here rows is an array . I want to delete rows array from subzones array.
This is what i did:
deleteRows = (idx, sub_idx) => {
// console.log(idx)
var taskl = this.state.subzones
var sub_taskl = this.state.subzones[idx].rows
sub_taskl.splice(sub_idx, 1);
taskl[idx].rows = sub_taskl
this.setState({
subzones: taskl
});
console.log("deleteRows", this.state.subzones)
};
But its not working . Any Suggestions?