From a758fb2a75d1b0a6af222a5fb4be28d556a0ac9f Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Tue, 13 Jul 2021 10:31:54 +0800 Subject: [PATCH] fix: empty error at jsx #4349 close #4349 --- components/_util/props-util/index.js | 7 ++++--- v2-doc | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/components/_util/props-util/index.js b/components/_util/props-util/index.js index c35e796fc..cf541dcf2 100644 --- a/components/_util/props-util/index.js +++ b/components/_util/props-util/index.js @@ -339,9 +339,10 @@ export function isEmptyContent(c) { export function isEmptyElement(c) { return ( - c.type === Comment || - (c.type === Fragment && c.children.length === 0) || - (c.type === Text && c.children.trim() === '') + c && + (c.type === Comment || + (c.type === Fragment && c.children.length === 0) || + (c.type === Text && c.children.trim() === '')) ); } diff --git a/v2-doc b/v2-doc index d2c096476..57c08127b 160000 --- a/v2-doc +++ b/v2-doc @@ -1 +1 @@ -Subproject commit d2c096476ee3e8d27fbb9e1cb7933887501b1fab +Subproject commit 57c08127bf0e3e826b03f845df3e1332820964e5