I'm currently using the package react-simple-star-rating with this example. But here's my problem :
My trains parameter contain a variable id I'd like to pass to the handleRating function using onClick but I can't figure it how.
const handleRating = (rate) => {
console.log(rate)
}
const trainingLine = (trains) => (
<Rating onClick={handleRating} ratingValue={Math.round(trains.rate.reduce((partialSum, a) => partialSum + a, 0)/trains.rate.length)}/>
)
Do you have an idea to achieve that ?