React Array Wenn ID vorhanden ist, fügen Sie kein Element hinzu
addPerson = (person) => {
let filteredPerson = this.state.likes.filter(like => like.name !== person.name);
this.setState({
likes: [...filteredPerson, person]
})
}
Yawning Yak