From e24c9ffa0be211b93918302be3cc9893c4004320 Mon Sep 17 00:00:00 2001 From: StandardGage <50509562+StandardGage@users.noreply.github.com> Date: Thu, 1 Feb 2024 20:25:31 -0500 Subject: [PATCH] Create simple react element if element has no children --- packages/integrations/react/client.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/integrations/react/client.js b/packages/integrations/react/client.js index cef488c83bc4..1b8d5be8337e 100644 --- a/packages/integrations/react/client.js +++ b/packages/integrations/react/client.js @@ -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,