material-tailwind
material-tailwind copied to clipboard
Rating is not reactive
even if the value changed to 0 it is not updating realtime. though other things are updating so it is not issue with re-renders.
<div>
<Rating value={Math.floor(rating)} readonly />
({ratingCount})
</div>
Same issue did you find a fix?
Ok so I did a bit of trial & error and wrapping the component made it update on re-renders, no idea why so if someone can explain it that would be great otherwise heres the code:
const RatingWrapper = ({ readonly, value }) => {
return (
<Rating
readonly={readonly}
value={value}
/>
);
};