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

Rating is loading 10 stars on refresh then quickly returning to 5 stars #49

Open
ZalwayJH opened this issue Jun 29, 2023 · 6 comments
Open

Comments

@ZalwayJH
Copy link

                 <Rating
                     iconsCount={5}
                     size={25}
                     ratingValue={0}
                     transition
                     allowFraction
                     readonly
                     initialValue={element}
                     fillColor="#D32748"
                   />

element is a tempory value just to see it working but it ranges from anywhere between 1 and 4, but it always loads as 5 out of 10 stars no matter what for a split second which messes up the layout with the increased height then quickly fixes itself. Any ideas what im doing wrong?

@digvijaySinghTntra
Copy link

digvijaySinghTntra commented Aug 7, 2023

Did you find any solution? I am facing the same issue.

@briancaow
Copy link

Im also facing the same issue

@YuriyYM
Copy link

YuriyYM commented Sep 29, 2023

Try to add your custom class with "display:none" property to fillClassName property of the Rating component.
It works for me

@chmcphoy
Copy link

chmcphoy commented Dec 6, 2023

Possibly a hydration issue, try seeing if it works on incognito - did for me.

If it works, upgrading to React 18.3.x or a framework specific solution could help, e.g this.

@james-deee
Copy link

james-deee commented Mar 9, 2024

@YuriyYM that did not work for me. Here's what i have

            <Rating
              allowFraction={true}
              readonly={true}
              initialValue={book.overall_rating}
              size={20}
              SVGclassName={"inline-block"}
              fillClassName="display:none"
            />

@shroommm
Copy link

shroommm commented May 22, 2024

I tried display: none with taillwindcss class (hidden) in fillClassName and it works.

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

7 participants