From 7be262ced140689cf684570533fb623a4723dc67 Mon Sep 17 00:00:00 2001 From: Mo Beigi Date: Fri, 29 Oct 2021 14:22:17 +1100 Subject: [PATCH] Allow resize to occur if style or className have changed (#459) --- src/core.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core.tsx b/src/core.tsx index c358486..9cb79d9 100644 --- a/src/core.tsx +++ b/src/core.tsx @@ -64,13 +64,12 @@ export default class EChartsReactCore extends PureComponent { return; } - // when thoes props isEqual, do not update echarts + // when these props are not isEqual, update echarts const pickKeys = ['option', 'notMerge', 'lazyUpdate', 'showLoading', 'loadingOption']; - if (isEqual(pick(this.props, pickKeys), pick(prevProps, pickKeys))) { - return; + if (!isEqual(pick(this.props, pickKeys), pick(prevProps, pickKeys))) { + this.updateEChartsOption(); } - this.updateEChartsOption(); /** * when style or class name updated, change size. */