Skip to content

Commit

Permalink
Create simple react element if element has no children
Browse files Browse the repository at this point in the history
  • Loading branch information
StandardGage committed Feb 2, 2024
1 parent 2ac3714 commit e24c9ff
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/integrations/react/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ function createReactElementFromDOMElement(element) {
attrs[attr.name] = attr.value;
}

// If the element has no children, we can create a simple React element
if (element.children.length === 0) {
return createElement(element.localName, attrs);
}

return createElement(
element.localName,
attrs,
Expand Down

0 comments on commit e24c9ff

Please sign in to comment.