Skip to content

Commit 5558f47

Browse files
authored
fix(space): filter out Comment nodes
1 parent ebeea03 commit 5558f47

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/components/space/space.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ export default defineComponent({
5656
function renderChildren() {
5757
const children = getFlatChildrenSlots();
5858
const separatorContent = renderTNodeJSX('separator');
59-
return children.map((child, index) => {
59+
return children
60+
.filter((child) => (isVNode(child) ? child.type !== Comment : true))
61+
.map((child, index) => {
6062
const isTeleport = isVNode(child) && child.type === Teleport;
6163
if (isTeleport) return null;
6264
// filter last child

0 commit comments

Comments
 (0)