kolking / react-native-rating

⭐️ ❤️ 😀 An interactive rating component for React Native that can display ratings using stars, hearts, emojis, or custom symbols.
MIT License
86 stars 5 forks source link

Can we use decimals? #7

Closed francisprovost closed 10 months ago

francisprovost commented 1 year ago

Hi!

It's really a nice component that you created!

I'm trying to use it to rate things with 0.5 steps but I seem to only receive integer values (from onChange or onMove). Is the decimal only possible with the default value or I missed something?

Thanks for you help!

kolking commented 1 year ago

Hey Francis and thank you! You're right, the onChange and onMove callbacks receive only integer values. I believe it's a common user experience to rate, and it's also harder and less intuitive to tap half of the star. Nevertheless, the component will display decimal values received in the rating prop (when it displays the total rating).

If I understood your case correctly, you want to use a scale from 0 to 5 with 0.5 step when user rate something. What about using the 0-10 scale then? I mean, you can set maxRating=10 to display 10 stars when asking your users to rate. Will that work for you?