tremorlabs / tremor

React components to build charts and dashboards
https://tremor.so
Apache License 2.0
15.81k stars 456 forks source link

[Bug]: Charts don't render in React 19 RC #1054

Open ZipBrandon opened 1 month ago

ZipBrandon commented 1 month ago

Tremor Version

3.17.2

Link to minimal reproduction

https://github.com/ZipBrandon/tremor-barchart-troubleshooting

Steps to reproduce

  1. clone and npm install
  2. npm run dev to view charts are not rendering
  3. change to 18.3.1 and npm install
  4. npm run dev to view charts are visible

What is expected?

Charts would render

What is actually happening?

Charts don't render

What browsers are you seeing the problem on?

No response

Any additional comments?

No response

severinlandolt commented 1 month ago

Hi! Tremor currently requires React 18.2+. V19 is not supported.

c.f. charts: https://github.com/recharts/recharts/issues/4558

eps1lon commented 1 month ago

Should no longer be blocked by recharts. React 19 support landed in recharts@2.13.0-alpha.3. There are some small bugs to fix but it doesn't block @tremor/react from starting to work on React 19.

severinlandolt commented 1 month ago

Thanks for the heads-up. Did not expect a react core member to wander around in our issues 🤣 Thank you!

ZipBrandon commented 1 month ago

@eps1lon has been the real MVP popping in everywhere for React 19 support as I have been playing whack-a-mole!

soyricardodev commented 1 month ago

Hi, I had this problem too, and the BarCharts still don't displaying, so i debugged and see an unexpected error with XAxis component and the height prop height={rotateLabelX?.xAxisHeight} this prop give me this Warning: Received NaN for theheightattribute. If this is expected, cast the value to a string. so I just simpli make this height={rotateLabelX?.xAxisHeight ?? 0} and my problem was fixed. This change was in the BarChart.tsx file of tremor, so i'm going to make my first pr