awran5 / react-simple-star-rating

A simple react component for adding a star rating to your project.
https://react-simple-star-rating.vercel.app/
MIT License
134 stars 30 forks source link

Cant reset rating from click on star #47

Open AlexanderChiclana opened 1 year ago

AlexanderChiclana commented 1 year ago

I am trying to build a rating system where you can reset the rating back to 0 by clicking on whatever star has already been set to the current value. For example, if a rating is showing 4 / 5 stars, clicking on the 4th star would remove the rating entirely.

I am using the initialValue prop and a controlled input as suggested,but the stars do not reset visually even though the state changes. I also built in a secondary button to test out the function and it it capable of clearing the rating.

Is there any way around this? Tried using a timeout and that didn't work

Mizan-Rifat commented 1 year ago

I've got the same issue. reset is not working

quantruong commented 1 year ago

Same issue with me