JYOTI DIXIT

JYOTI DIXIT

  • NA
  • 58
  • 624

How to increment count of specific id when hit like button ?

Jun 3 2022 7:34 AM

 private handleClick = event => {

 

    const params = new URLSearchParams(window.location.search);

    let Useridval = params.get('ID');

    console.log(event.currentTarget.id);

    this.setState({ count: this.state.count + 1 })

  };

 

  <button

                  //onSelect={currentId}

                  onClick={this.handleClick}>like</button>


Answers (1)