From 3ccc7b127ab644a842caacdb00da7b7a4dc7d69f Mon Sep 17 00:00:00 2001 From: Thomas Marwitz Date: Tue, 1 Feb 2022 13:30:47 +0100 Subject: [PATCH] fixed graph re-rendering, and optimized it --- src/views/landingPage/Graph/Graph.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/landingPage/Graph/Graph.js b/src/views/landingPage/Graph/Graph.js index 1296688c..04b5573d 100644 --- a/src/views/landingPage/Graph/Graph.js +++ b/src/views/landingPage/Graph/Graph.js @@ -47,11 +47,12 @@ function Graph(props) { } else if (activeData.status === REQUEST_STATE.success) { const {series, styling} = generateSeries({plotId, data: activeData.data, modelsSlice, xAxisRange, yAxisRange}); const options = getOptions({plotId, styling, plotTitle}); - return + const uniqueNumber = Date.now(); // forces apexcharts to re-render correctly! + return }; // this "case" should not happen return CRITICAL: an internal error occurred that shouldn't happen!; } -export default React.memo(Graph); // prevent graph from rerendering if sidebar is opened and closed +export default React.memo(Graph, () => true); // prevent graph from rerendering if sidebar is opened and closed -- GitLab