score:0

You have to persist on server side you are only setting the state so change your handleClick function like this using axios

handleClick: function(event) {
  // post to server using ajax here
  this.setState({liked: !this.state.liked, id: this.prop.id});
  liked = this.state.liked;
  id = this.prop.id;
  axios.post('/YOUR_LIKE_UNLIKE_API_END_POINT', {
    liked: liked,
    id: id
  }).catch(function (error) {
    this.setState({liked: !this.state.liked, id: this.prop.id});
  });
},

Related Query

More Query from same tag