From ca963df07c0131fc4872abb56a8cc54e9f81f154 Mon Sep 17 00:00:00 2001 From: xile611 Date: Thu, 27 Mar 2025 10:00:07 +0800 Subject: [PATCH 1/2] fix: children of tooltip should not be set to spec --- packages/react-vchart/src/charts/BaseChart.tsx | 2 +- packages/react-vchart/src/components/BaseComponent.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/react-vchart/src/charts/BaseChart.tsx b/packages/react-vchart/src/charts/BaseChart.tsx index 226a03a7be..d9b0840317 100644 --- a/packages/react-vchart/src/charts/BaseChart.tsx +++ b/packages/react-vchart/src/charts/BaseChart.tsx @@ -252,7 +252,7 @@ const BaseChart: React.FC = React.forwardRef((props, ref) => { if ( !isEqual(newSpec, prevSpec.current, { skipFunction: skipFunctionDiff }) || - !isEqual(newSpecFromChildren, specFromChildren.current) + !isEqual(newSpecFromChildren, specFromChildren.current, { skipFunction: skipFunctionDiff }) ) { prevSpec.current = newSpec; specFromChildren.current = newSpecFromChildren; diff --git a/packages/react-vchart/src/components/BaseComponent.tsx b/packages/react-vchart/src/components/BaseComponent.tsx index 996f8067d1..281deadc9a 100644 --- a/packages/react-vchart/src/components/BaseComponent.tsx +++ b/packages/react-vchart/src/components/BaseComponent.tsx @@ -22,7 +22,8 @@ export const createComponent = ( VChart.useRegisters(registers); } - const ignoreKeys = ['updateId', 'componentId']; + // tooltip component 不支持 children,其他组件暂时也都不支持 + const ignoreKeys = ['updateId', 'componentId', 'children']; const notSpecKeys = supportedEvents ? Object.keys(supportedEvents).concat(ignoreKeys) : ignoreKeys; const Comp: React.FC = (props: T) => { From 2a25c835e88f32b142cfddd2b1a9348670391ac6 Mon Sep 17 00:00:00 2001 From: xile611 Date: Thu, 27 Mar 2025 10:02:18 +0800 Subject: [PATCH 2/2] docs: update changelog of rush --- .../fix-react-vchart-children_2025-03-27-02-02.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@visactor/vchart/fix-react-vchart-children_2025-03-27-02-02.json diff --git a/common/changes/@visactor/vchart/fix-react-vchart-children_2025-03-27-02-02.json b/common/changes/@visactor/vchart/fix-react-vchart-children_2025-03-27-02-02.json new file mode 100644 index 0000000000..b9320c376b --- /dev/null +++ b/common/changes/@visactor/vchart/fix-react-vchart-children_2025-03-27-02-02.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vchart", + "comment": "fix(react-vchart): children of tooltip should not be set to spec", + "type": "none" + } + ], + "packageName": "@visactor/vchart" +} \ No newline at end of file