I have an existing code here that update employee and show the updated employee. I also have a filter dropdowns that filters the data but after filtering the data and updating it. It only shows the updated filtered data due to the setEmployees(newEmployees).
function updateEmployee(index, employee) {
const newEmployees = employees.slice();
newEmployees[index] = employee;
setEmployees(newEmployees);
//setEmployees(updatedEmployee and all the data)
}
What I want to happen is after updating it. The previous data is still there as well as the updated one