From 715e1daee0b660dfeb37e104a1a57325f46fbf70 Mon Sep 17 00:00:00 2001 From: Wenli Zhang Date: Mon, 1 Aug 2022 14:32:54 +0800 Subject: [PATCH] fix(custom): set ignore only if old child exists (#17450) --- src/chart/custom/CustomView.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/chart/custom/CustomView.ts b/src/chart/custom/CustomView.ts index 215087b72b..ad282ed9b0 100644 --- a/src/chart/custom/CustomView.ts +++ b/src/chart/custom/CustomView.ts @@ -1340,6 +1340,13 @@ function mergeChildren( ); } else { + if (__DEV__) { + assert( + oldChild, + 'renderItem should not return a group containing elements' + + ' as null/undefined/{} if they do not exist before.' + ); + } // If the new element option is null, it means to remove the old // element. But we cannot really remove the element from the group // directly, because the element order may not be stable when this