Using amCharts 5 with Next.js

Next.js is a React framework, so the code in our React tutorial will work.

However, Next.js also uses SSR, which does not work with amCharts. In order to use amCharts with Next.js, you must disable SSR for your amCharts component:

import dynamic from 'next/dynamic';

const ChartComponent = dynamic(() => import('./components/chart'), { ssr: false });

function App() {
  return <ChartComponent />;