fix: empty error at jsx #4349

close #4349
pull/4361/head
tangjinzhou 2021-07-13 10:31:54 +08:00
parent 39c866eb02
commit a758fb2a75
2 changed files with 5 additions and 4 deletions

View File

@ -339,9 +339,10 @@ export function isEmptyContent(c) {
export function isEmptyElement(c) { export function isEmptyElement(c) {
return ( return (
c.type === Comment || c &&
(c.type === Comment ||
(c.type === Fragment && c.children.length === 0) || (c.type === Fragment && c.children.length === 0) ||
(c.type === Text && c.children.trim() === '') (c.type === Text && c.children.trim() === ''))
); );
} }

2
v2-doc

@ -1 +1 @@
Subproject commit d2c096476ee3e8d27fbb9e1cb7933887501b1fab Subproject commit 57c08127bf0e3e826b03f845df3e1332820964e5