I have mo state array that gets its value from the rest api get request. Those values are visualized in a table that has option to delete the particular mo object by considering the name of the mo.
The below added logic is to slice the mo object from the table and in the backend as well. And the UpdateMO will update the new mo which populates the current mo objects.
While I do this, the value gets deleted but the table row is not removed. Empty row is still present. Next Time I delete again the row gets deleted. How to splice and update the mo at the same time
for(var index = 0;index < mo.length; index++){
if(index !== -1 && mo[index]['name'] === name){
mo.splice(index, 1);
UpdateMO((mo) => [...mo, mo]);
}
}