what is the way to delete element in react js code example
Example: remove item react
delete(id){
this.setState(prevState => ({
data: prevState.data.filter(el => el != id )
}));
}
delete(id){
this.setState(prevState => ({
data: prevState.data.filter(el => el != id )
}));
}