Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initialValue is not working #15

Open
hacktronics opened this issue Feb 10, 2022 · 4 comments
Open

initialValue is not working #15

hacktronics opened this issue Feb 10, 2022 · 4 comments

Comments

@hacktronics
Copy link

initialValue={5}
it does not respect that, and initially it is showing as blank only with no stars filled, even with readonly settings.

@htmllab
Copy link

htmllab commented Mar 16, 2022

1+

@DMills-hub
Copy link

For anyone having an issue with this it will respect the initialValue if you don't pass ratingValue.

This is a bit of a nuisance especially when using typescript as you will get a ts error (only way around this is to use @ts-ignore) saying that ratingValue must be passed.

Should be a simple fix by changing this line -

To be ratingValue?: number since the ratingValue is already being set to 0 if it is not passed.

@aquadesk
Copy link

Thanks.

    <Rating
                  initialValue={data?.rating}
                  ratingValue={0}
                  size={50}
                  readonly
                  transition
                  allowHalfIcon
                />

this worked

@awran5
Copy link
Owner

awran5 commented Oct 3, 2022

Thank you guys. This issue should be fixed in the latest release

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

No branches or pull requests

5 participants