Skip to content

Added ability to update stars rating outside the component - #9

Closed
fighterinthewind wants to merge 2 commits into
f0rr0:masterfrom
fighterinthewind:master
Closed

Added ability to update stars rating outside the component#9
fighterinthewind wants to merge 2 commits into
f0rr0:masterfrom
fighterinthewind:master

Conversation

@fighterinthewind

Copy link
Copy Markdown

No description provided.

Comment thread src/rating.js


componentWillReceiveProps(nextProps) {
this.animate(nextProps.initial, false)()

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calling setState here should be enough ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it should not be enough.
It works exactly how I implemented it.

@f0rr0

f0rr0 commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Thanks for contributing this. Closing because the current v4 API now supports explicit controlled usage with value plus onChange and uncontrolled usage with defaultValue. This patch targets the removed src/rating.js and conflicts with master; the componentWillReceiveProps implementation also resets and reanimates from initial on every parent update, even when that value is unchanged. The original use case is covered by the current API.

@f0rr0 f0rr0 closed this Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants