n49 / react-stars

A simple star rating component for your React projects :star:
http://developers.n49.com/react-stars/
218 stars 82 forks source link

Why use edit prop but it does not work? #77

Closed Inchill closed 9 months ago

Inchill commented 9 months ago
<ReactStars
    className={cx('rating')}
    count={5}
    half={false}
    value={formData.score}
    onChange={ratingChanged}
    size={30}
    color1='#F2F2F2'
    color2='#FADB15'
    edit={!hasSubmitted}
/>

When I've submitted form, the rating star actually can interactive with users, so how to solve this problem?

Inchill commented 9 months ago

I've found a way using key to make the component rerender.

Inchill commented 9 months ago

The issue has been solved.