From 7789cb298990e56fb862907db7a8f4d32c3b05bd Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Thu, 28 Apr 2022 10:49:16 +0800 Subject: [PATCH] fix: table customRender fragment warning, close #5556 --- components/vc-table/Cell/index.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/components/vc-table/Cell/index.tsx b/components/vc-table/Cell/index.tsx index da292245a..43172ae79 100644 --- a/components/vc-table/Cell/index.tsx +++ b/components/vc-table/Cell/index.tsx @@ -33,7 +33,7 @@ function inHoverRange(cellStartRow: number, cellRowSpan: number, startRow: numbe function isRenderCell( data: RenderedCell, ): data is RenderedCell { - return data && typeof data === 'object' && !Array.isArray(data) && !isValidElement(data); + return data && typeof data === 'object' && !Array.isArray(data) && !isVNode(data); } export interface CellProps { @@ -245,12 +245,8 @@ export default defineComponent({ } } - // Not crash if final `childNode` is not validate ReactNode - if ( - typeof childNode === 'object' && - !Array.isArray(childNode) && - !isValidElement(childNode) - ) { + // Not crash if final `childNode` is not validate VueNode + if (typeof childNode === 'object' && !Array.isArray(childNode) && !isVNode(childNode)) { childNode = null; }