@builderx/bridge
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -271,3 +271,4 @@ "use strict"; | ||
function getRootFiberNode() { | ||
const rootElement = document.querySelector('body div'); | ||
const bodyElement = document.querySelector('body'); | ||
const rootElement = bodyElement === null || bodyElement === void 0 ? void 0 : bodyElement.querySelector('[data-path]'); | ||
if (!rootElement) { | ||
@@ -274,0 +275,0 @@ console.error('No element with data-path attribute found'); |
{ | ||
"name": "@builderx/bridge", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
@@ -330,3 +330,6 @@ declare global { | ||
function getRootFiberNode(): any { | ||
const rootElement = document.querySelector('body div'); | ||
const bodyElement = document.querySelector('body'); | ||
const rootElement = bodyElement?.querySelector('[data-path]'); | ||
if (!rootElement) { | ||
@@ -470,2 +473,3 @@ console.error('No element with data-path attribute found'); | ||
const propsChildren = fiber?.memoizedProps?.children; | ||
if (!propsChildren && !fiber?.child) { | ||
@@ -652,3 +656,2 @@ return false; // If there are no children in props, we assume it's a component | ||
return element; | ||
@@ -655,0 +658,0 @@ } |
Sorry, the diff of this file is not supported yet
82743
1562