BarChart: fix excessive viz re-init due to cloneDeep(props) (#43293) (#43313)

(cherry picked from commit e240c21a43)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2021-12-19 07:46:31 +01:00
committed by GitHub
co-authored by Leon Sorokin
parent 35a109a076
commit 0d390c6c12
@@ -1,5 +1,4 @@
import React, { useRef } from 'react';
import { cloneDeep } from 'lodash';
import { DataFrame, FieldType, TimeRange } from '@grafana/data';
import { GraphNG, GraphNGProps, PlotLegend, UPlotConfigBuilder, usePanelContext, useTheme2 } from '@grafana/ui';
import { LegendDisplayMode } from '@grafana/schema';
@@ -91,8 +90,7 @@ export const BarChart: React.FC<BarChartProps> = (props) => {
return (
<GraphNG
// My heart is bleeding with the clone deep here, but nested options...
{...cloneDeep(props)}
{...props}
theme={theme}
frames={props.frames}
prepConfig={prepConfig}