Answers for "react array if id is present do not add element"

0

react array if id is present do not add element

addPerson = (person) => {
    let filteredPerson = this.state.likes.filter(like => like.name !== person.name);
    this.setState({
      likes: [...filteredPerson, person]
    })        
  }
Posted by: Guest on May-23-2020

Code answers related to "react array if id is present do not add element"

Code answers related to "Javascript"

Browse Popular Code Answers by Language