Closed TimDaub closed 8 years ago
I agree. When I first created this, I wasn't so clear on the necessity to create stateless components. There are some flaws in the architecture that I'll be working to fix. Feel free to submit a PR if you have any new ideas. Thanks for the suggestion.
I ran into this issue too. It looks like the component has no componentWillReceiveProps() defined... I was able to fix my issue by adding
componentWillReceiveProps(nextProps) { this.setState({ disabled: nextProps.disabled, editing: nextProps.editing }); }
Imagine using this component in combination with flux stores.
There can be an initial value a user has previously set in another session that is now submitted to the component via the
rating
prop. Unfortunately though, when setting the rating prop initially without clicking on it (and triggeringhandleClick
).this.state.ratingCache
is not set. This has the effect that when the user hovers over a initially set rating component, it basically resets it to no rating at all.So, there should be either a method/flag or what ever that makes sure that the initial value is set in the cache.