From 2954345f3f9ac78ce434f34104a100735b945ff9 Mon Sep 17 00:00:00 2001 From: thinkinggis Date: Mon, 24 Feb 2020 14:54:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20l7=20react=20source=20update=20=E6=9C=BA?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/react/src/component/LayerAttribute/Active.tsx | 2 +- packages/react/src/component/LayerAttribute/Filter.tsx | 2 +- packages/react/src/component/LayerAttribute/Size.tsx | 2 +- packages/react/src/component/LayerAttribute/Source.tsx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react/src/component/LayerAttribute/Active.tsx b/packages/react/src/component/LayerAttribute/Active.tsx index 92aafb75e8..1145d449d7 100644 --- a/packages/react/src/component/LayerAttribute/Active.tsx +++ b/packages/react/src/component/LayerAttribute/Active.tsx @@ -12,6 +12,6 @@ export default React.memo(function Chart(props: ILayerProps) { const { layer, active } = props; useEffect(() => { layer.active(active.option); - }, [active, layer]); + }, [JSON.stringify(active)]); return null; }); diff --git a/packages/react/src/component/LayerAttribute/Filter.tsx b/packages/react/src/component/LayerAttribute/Filter.tsx index 92285b8f36..fff0a6c2e4 100644 --- a/packages/react/src/component/LayerAttribute/Filter.tsx +++ b/packages/react/src/component/LayerAttribute/Filter.tsx @@ -13,6 +13,6 @@ export default React.memo(function Chart(props: ILayerProps) { if (filter.field) { layer.filter(filter.field as string, filter.values as StyleAttrField); } - }, [filter.field, JSON.stringify(filter.values), filter.values]); + }, [filter.field, JSON.stringify(filter.values)]); return null; }); diff --git a/packages/react/src/component/LayerAttribute/Size.tsx b/packages/react/src/component/LayerAttribute/Size.tsx index 92671a4fe4..399a873690 100644 --- a/packages/react/src/component/LayerAttribute/Size.tsx +++ b/packages/react/src/component/LayerAttribute/Size.tsx @@ -13,6 +13,6 @@ export default React.memo(function Chart(props: ILayerProps) { size.field ? layer.size(size.field, size.values) : layer.size(size.values as StyleAttrField); - }, [size.field, size.values, size.scale]); + }, [size.field, JSON.stringify(size.values), size.scale]); return null; }); diff --git a/packages/react/src/component/LayerAttribute/Source.tsx b/packages/react/src/component/LayerAttribute/Source.tsx index edccf83784..d460adbc8f 100644 --- a/packages/react/src/component/LayerAttribute/Source.tsx +++ b/packages/react/src/component/LayerAttribute/Source.tsx @@ -17,6 +17,6 @@ export default React.memo(function Chart(props: ISourceProps) { } else { layer.setData(data, sourceOption); } - }, [data, sourceOption]); + }, [data, JSON.stringify(sourceOption)]); return null; });