mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Updating Chart on every componentDidUpdate
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
29e7051a32
commit
c0d4169cf0
@ -63,14 +63,14 @@ export class Chart extends React.Component<ChartProps> {
|
||||
this.renderChart()
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps: ChartProps) {
|
||||
const { data, showChart, redraw } = this.props
|
||||
componentDidUpdate() {
|
||||
const { showChart, redraw } = this.props
|
||||
if (redraw) {
|
||||
this.chart.destroy()
|
||||
this.renderChart()
|
||||
return
|
||||
}
|
||||
if (!isEqual(prevProps.data, data) && showChart) {
|
||||
if (showChart) {
|
||||
if (!this.chart) this.renderChart()
|
||||
else this.updateChart()
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user