Skip to content

Commit 13a01f7

Browse files
authored
fix(kiali): use prevState callback (#874)
Signed-off-by: Tomas Coufal <[email protected]>
1 parent 1150451 commit 13a01f7

File tree

1 file changed

+3
-1
lines changed
  • plugins/kiali/src/components/Overview/OverviewCard/OverviewMetrics/OverviewChart

1 file changed

+3
-1
lines changed

plugins/kiali/src/components/Overview/OverviewCard/OverviewMetrics/OverviewChart/SparklineChart.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ export class SparklineChart extends React.Component<Props, State> {
9898
// Was not already hidden => add to set
9999
this.state.hiddenSeries.add(idx);
100100
}
101-
this.setState({ hiddenSeries: new Set(this.state.hiddenSeries) });
101+
this.setState(prevState => ({
102+
hiddenSeries: new Set(prevState.hiddenSeries),
103+
}));
102104
return null;
103105
},
104106
onMouseOver: props => {

0 commit comments

Comments
 (0)