-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Support React 19 #4558
Comments
React 19 will be added to peerDependencies when recharts supports it. Edit: Current alpha https://www.npmjs.com/package/recharts/v/2.13.0-alpha.4 |
Going to edit the title if you don't mind to just "Support React 19", and use this to track support in 2.x |
Alpha release - https://www.npmjs.com/package/recharts/v/2.13.0-alpha.0 use this to determine what is breaking/what isn't. I just don't have bandwidth to fix it myself Things that I know are broken: Bar |
https://www.npmjs.com/package/recharts/v/2.13.0-alpha.2 Please test this one as well on all React versions 16.8-19 to see if anyone runs into issues. Thanks! 🚀 |
In order to use React 19 one must override the
|
appreciate your work @ckifer |
My only issue remaining is |
@juliusmarminge Not sure why the types broke, are there React 19 types released? I can't seem to reproduce. But might need to add explicit Also noticed that @rauchg - I think probably another defaultProps issue that hasn't been caught yet. Will take another look Edit: for Legend for now you can just add the defaultProps back yourself (not sure if you can do this in Tremor)
|
I've also noticed a particular difference only when updating from I have an AreaChart (without set height/width) wrapped with ResponsiveContainer:
After updating though, the same exact code does not render the graph in any way I have tried with both set/dynamic dimensions on the AreaChart component, ResponsiveContainer or the other wrapping html tags (following the examples on the docs website) but the chart either doesn't render at all or loses all the responsive features it had before. Is this also true on your end? |
@emanuele-moricci this sounds like your version of react-is hasn't been overridden #4558 (comment) Try to npm ls react-is and see if it gives you multiple versions. |
And you'd be right! For future reference: After that, I cancelled the |
You definitely need to force
|
https://www.npmjs.com/package/recharts/v/2.13.0-alpha.3 Alpha-3 should fix the Legend issues mentioned above. Please continue to report other issues as you run into them, thanks! |
Thanks @tobiaslins will look into it |
@tobiaslins I can reproduce here https://codesandbox.io/p/sandbox/stacked-bar-chart-7fwfgj |
recharts/src/util/ChartUtils.ts Line 1064 in fad4d30
This is why stacks fail - we expect an axisId to be present but it isn't getting defaulted because of the way defaulProps are read. This one doesn't seem as reasonable to refactor as the other ones so for now specifying axisIds on you graphical items and axes should fix it. Will work on a fix in the meantime |
Please how did you achieve the
@GetPsyched please how did you achieve this. thanks. |
I added an override for the |
React 19 is now stable - https://react.dev/blog/2024/12/05/react-19 Will look at an update for peerDependencies when I can |
@ckifer thanks for making the update to allow React 19 in the peerDeps. is it possible to get a build out with that update? This is the last dependency that's not allowing us to update to React 19 without forcing legacy peer deps. |
@reintroducing ack but currently on a trip for work. I will make a new release when I get a few minutes or once I get home tomorrow Thanks for understanding |
@ckifer appreciate the quick reply, thank you very much. |
https://github.com/recharts/recharts/releases/tag/v2.15.0 Released update to peerDeps in 2.15 You will still need to make sure react-is is correctly overridden Going to close this! |
@ckifer works as expected as far as I can tell, thank you for the quick turn around on this, much appreciated. |
Still has a warning because of this submodule: recharts/react-smooth#106 |
Ok will update that this week |
Done in 4.0.4^ |
What is the latest ? or it is the latest react-is... |
It must match your react and react-dom version So today "react": "19.0.0",
"react-dom": "19.0.0", ... "overrides": {
"react-is": "19.0.0"
} |
Thanks a lot! |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Charts do not render when using React 19, or when using NextJS 14.3 (which uses React 19).
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via codesandbox or similar (template: https://codesandbox.io/p/sandbox/simple-line-chart-v25dl4).
Install react@rc or react@beta
Observe charts do not render
https://github.com/justinh00k/recharts-react19-repro
What is the expected behavior?
Charts render
Which versions of Recharts, and which browser / OS are affected by this issue? Did this work in previous versions of Recharts?
2.12.7 / No
The text was updated successfully, but these errors were encountered: