mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-12 10:33:49 +00:00
Update bootstrap and chart.js
This commit is contained in:
@@ -38,7 +38,8 @@ const generateChartData = (labels: string[], data: number[]): ChartData => ({
|
||||
});
|
||||
|
||||
export const DoughnutChart: FC<DoughnutChartProps> = memo(({ stats }) => {
|
||||
const [chartRef, setChartRef] = useState<Chart | undefined>(); // Cannot use useRef here
|
||||
// Cannot use useRef here, as we need to re-render as soon as the ref is set
|
||||
const [chartRef, setChartRef] = useState<Chart>();
|
||||
const labels = keys(stats);
|
||||
const data = values(stats);
|
||||
|
||||
@@ -61,7 +62,9 @@ export const DoughnutChart: FC<DoughnutChartProps> = memo(({ stats }) => {
|
||||
data={chartData as any}
|
||||
options={options as any}
|
||||
ref={(element) => {
|
||||
setChartRef(element ?? undefined);
|
||||
if (element) {
|
||||
setChartRef(element as Chart);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user