Skip to content
This repository was archived by the owner on Aug 9, 2023. It is now read-only.

Commit b0bff0d

Browse files
committed
Fix warnings in react for void elements w/ children
1 parent 7f54c77 commit b0bff0d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,12 @@ function toH(h, node, ctx) {
176176
}
177177
}
178178

179+
/* Ensure no React warnings are triggered for
180+
* void elements having children passed in. */
181+
if (!elements.length) {
182+
elements = undefined;
183+
}
184+
179185
return h(selector, attributes, elements);
180186
}
181187

0 commit comments

Comments
 (0)