react-rating icon indicating copy to clipboard operation
react-rating copied to clipboard

bugs with 1 decimal places in placeholderRate

Open Eliceeeeeee opened this issue 8 years ago • 2 comments
trafficstars

When I try <Rating empty={<img src="emptystar.svg" />} full={<img src="fullstar.svg" /> placeholder={<img src="fullstar.svg" />} placeholderRate={2.8} />

when the placeholderRate in decimal place of 0.1, 0.2 , 0.8 and 0.9, it will occurs check sum issues in Microsoft Edge browser and IE

Warning: React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server: (client) dth:79.99999999999998%;" data-reactid=". (server) dth:79.99999999999999%;" data-reactid=".

it work fine in other browser.

Please fix the bugs. Thank you!!!

Eliceeeeeee avatar Apr 25 '17 12:04 Eliceeeeeee

It looks like the width is computed differently on server and client side. Does it only happen with placeholderRate? Does it happen with initialRate too?

<Rating empty={<img src="emptystar.svg" />} full={<img src="fullstar.svg"} />} initialRate={2.8} />

Maybe the server side engine rounds doubles different than IE engine 😅. Maybe server engine is the same engine as used by Chrome giving exactly the same result.

dreyescat avatar Apr 26 '17 16:04 dreyescat

Yes, it happens also with initialRate too. Is it anyway to solve this issue on IE engine. I check the behind code is using Math.floor() function.

Eliceeeeeee avatar May 03 '17 02:05 Eliceeeeeee