Recharts - Warning: Prop `id` did not match. Server:
See original GitHub issueBug report
Describe the bug
When using rechart
I am getting a mismatch error between server and client. The props that are mismatching seem to change arbitrary, sometimes it’s id
but I also had other cases, where it was y
.
To Reproduce:
- Clone Repo
yarn install
yarn dev
- navigate to
http://localhost:3030/sample
with open console
Expected behavior
No warning in the console.
Screenshots
Added in the repo.
System information
- OS: MacBookPro 16"
- Browser (if applies): Chrome
- Version of Next.js: 9.3.6
- Version of Node.js: 13.13.0
Additional context
I had a similar problem with react-bootstrap. I would really appreciate a blogpost or extended documentation that explains what is happening here.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
how to resolve "Prop `id` did not match. Server: "react-tabs-30 ...
This error means that something on the server is different from the Client. This can happen if the client does a re-render. For...
Read more >Common Errors in React JS Project Why It Happens?, What ...
Warning: Prop id did not match. ... The recharts graph data while running the page server-side rendering is failed. that's why it's happened ......
Read more >how to resolve "Prop `id` did not match. Server: "react-tabs-30 ...
This error means that something on the server is different from the Client. This can happen if the client does a re-render. For...
Read more >Warning: Prop 'Id' Did Not Match. Using Tinymce With Next Js
This is a generic Next.js warning that happens when the DOM in the client does not exactly match the DOM that was rendered...
Read more >Rechart を Next.js で使うと「Warning: Prop id did not ... - Qiita
これは Next.js の一般的な警告です。 クライアントの DOM とサーバーでレンダリングされた DOM が正確に一致しない場合に発生します。この場合、recharts ...
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
It looks like some components just can’t be server rendered with recharts https://github.com/recharts/recharts/issues/359
One way around this is to not server render your chart:
This is a generic Next.js warning that happens when the DOM in the client does not exactly match the DOM that was rendered on the server. In this case, you’re seeing it because the recharts id is different on the client side. It’s not a serious error so the easiest option is probably to ignore it.
Someone else might be able to shed more light on how to make the error go away, but I hope this explains why you’re seeing it