Skip to content

Instantly share code, notes, and snippets.

@codeBelt
Last active November 29, 2020 18:55
Show Gist options
  • Save codeBelt/bb3cf8e7b9dfc9cc4507b4ceaa190d67 to your computer and use it in GitHub Desktop.
Save codeBelt/bb3cf8e7b9dfc9cc4507b4ceaa190d67 to your computer and use it in GitHub Desktop.
// SimpleBarChart.tsx
export const SimpleBarChart: React.FC<IProps> = (props) => {
const chartData = useMemo(() => generateSimpleBarChart(), []);
return (
<AnyChartReact
charts={chartData.charts}
credits={false}
instance={chartData.stage}
legend={true}
title={props.title}
height={props.height}
width={props.width}
id={props.chartId}
/>
);
};
// SimpleBarChart.dynamic.tsx
import dynamic from 'next/dynamic';
import { SimpleBarChart } from './SimpleBarChart';
export const SimpleBarChartDynamic = dynamic(
() => import('./SimpleBarChart' /* webpackChunkName: "SimpleBarChart" */).then((mod) => mod.SimpleBarChart as any),
{ ssr: false }
) as typeof SimpleBarChart;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment