using toLocaleString in markup throws checksum error
See original GitHub issueHere is the problem I have a piece of code inside one of my components:
<span>{info.minPrice.toLocaleString('fa')} تومان به بالا </span>
when I run the application I get this error:
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) react-text: 1921 -->۲٬۵۳۴٬۹۰۰<!-- /react
(server) react-text: 1921 -->2,534,900<!-- /react
nothing else is involved in this problem if I simply remove .toLocaleString function It will work without any errors.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
using toLocaleString in markup throws checksum error #2590
Warning: React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server ...
Read more >How to avoid React markup checksum warnings when ...
I know that's why it's happening, but I'm rendering something that's inherently progressing. The error is introduced between the time the server finishes ......
Read more >js format date locale Code Example - Code Grepper
tolocaledatestring throws exception · null error due to delay in api response · API. · find out process using port windows · how...
Read more >WjBarcodeDataMatrixEcc000 Class | Wijmo API - GrapeCity
Use the wj-barcode-data-matrix-ecc000 component to add DataMatrixEcc000 controls to your Angular 2 applications. For details about Angular 2 markup syntax, ...
Read more >Throws - Markup Formatting Reference - Apple Developer
Throws. Add the Throws section to Quick Help for a symbol using the Throws delimiter. Use the throws section to specify any errors...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@iamsoorena This is not Next.js related issue. It has to do with Node’s poor internationalization support (node had intl issues since always); so what’s going on in your case is that server side you render number
16
: while client side you render ۱۶.Assuming you are dealing only with Farsi, I think your best bet would be to use persianjs package, and then you can have something like:
Thanks a lot @Blistok .