TanStack / react-charts

⚛️ Simple, immersive & interactive charts for React
https://react-charts.tanstack.com
MIT License
2.98k stars 243 forks source link

How to get this working with TS and MUI? #286

Closed georgiosd closed 2 years ago

georgiosd commented 2 years ago

Any ideas?

I keep getting the Error: Hydration failed because the initial UI does not match what was rendered on the server.

Latest NextJS and MUI based on the example

georgiosd commented 2 years ago

For anyone who comes across this, the solution was to dynamically import the component that uses a chart:

const CashflowChart = dynamic(import('components/CashflowChart'), { ssr: false })

And, another gotcha - the chart needs its container to have a set height, or use the ResizableBox from the example sandbox.