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

Stars change even if onChange fails and the value does not change #45

Open s7dhansh opened 6 years ago

s7dhansh commented 6 years ago

If the star value remains unchanged even after clicking the stars (due to a failure in the onChange method or otherwise), the stars retain their changed state, instead of reverting to the original.

I think https://github.com/n49/react-stars/blob/b3455bd492bc5efde050b834b55b01b2065e159b/src/react-stars.js#L91 must have this.props.value and not this.state.value. Let me know and I can push a PR.