From 382d7b1c9f1e5a954f86e83d5d790b24b328a812 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 18 Sep 2021 12:34:14 +0200 Subject: [PATCH] Improved comment --- src/visits/helpers/DefaultChart.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/visits/helpers/DefaultChart.tsx b/src/visits/helpers/DefaultChart.tsx index 1694d52a..73107748 100644 --- a/src/visits/helpers/DefaultChart.tsx +++ b/src/visits/helpers/DefaultChart.tsx @@ -150,6 +150,7 @@ const DefaultChart = memo(( const chartData = generateChartData(isBarChart, labels, data, highlightedData, highlightedLabel); const height = determineHeight(isBarChart, labels); + // Provide a key based on the height, to force re-render every time the dataset changes (example, due to pagination) const renderChartComponent = (customKey: string) => ( { @@ -163,7 +164,6 @@ const DefaultChart = memo(( /> ); - // Provide a key based on the height, so that every time the dataset changes, a new chart is rendered return (