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

This commit is contained in:
Leon Sorokin 2021-12-19 00:26:25 -06:00 committed by GitHub
parent 33c64dba38
commit e240c21a43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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}