Last active
November 29, 2020 18:55
-
-
Save codeBelt/bb3cf8e7b9dfc9cc4507b4ceaa190d67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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} | |
/> | |
); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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