Everything is working fine.
The problem is when I press the delete button, it deletes but not immediately from table. It deletes when I reload the page. I replace the student array in localStorage when I press delete. Your help will be appreciated. Thank you in advance.
const history = useHistory();
let student = JSON.parse(localStorage.getItem('student'))
This is the function for the deletion of an item
const deleteStudent = (event)=>{
let id = event.currentTarget.id
let students = student.map(student=>Number(student.id))
let index = students.indexOf(Number(id))
student.splice(index,1)
localStorage.setItem('student',JSON.stringify(student))
}