Skip to content

Commit 695fe50

Browse files
Fix: Correctly check if childNodes is set
1 parent de48e50 commit 695fe50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/react.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function renderElementNode(node: Node & ChildNode, options: Config) {
8787
return React.cloneElement(element.override(element.attributes, node.textContent))
8888
}
8989

90-
if (element.childNodes) {
90+
if (element.childNodes && element.childNodes.length > 0) {
9191
return React.createElement(element.nodeName, element.attributes, render(element.childNodes, options))
9292
}
9393
return React.createElement(element.nodeName, element.attributes)

0 commit comments

Comments
 (0)