diff --git a/example/app/app/+html.tsx b/example/app/app/+html.tsx index c6c1fe3b..03becf4c 100644 --- a/example/app/app/+html.tsx +++ b/example/app/app/+html.tsx @@ -35,14 +35,15 @@ export default function Root({ children }: { children: React.ReactNode }) { dangerouslySetInnerHTML={{ __html: ` window.addEventListener("load", () => { + console.log("load called!"); + console.log(window.location.search); // get in_doc search param and condition if it's set to true const inDoc = window.location.search.includes("in_doc=true"); - + console.log("inDoc", inDoc); if (!inDoc) { return; } - console.log("events called!"); const carouselComponent = document.getElementById("carousel-component"); console.log("carouselComponent exists!"); console.log(carouselComponent); diff --git a/example/app/app/_layout.tsx b/example/app/app/_layout.tsx index d15caa18..4ca1a769 100644 --- a/example/app/app/_layout.tsx +++ b/example/app/app/_layout.tsx @@ -57,34 +57,6 @@ function RootLayoutNav() { const [isRTL, setIsRTL] = useState(I18nManager.isRTL); const { inDoc } = useInDoc(); - useEffect(() => { - console.log( - { - IS_WEB, - inDoc, - }, - "====", - ); - if (IS_WEB && inDoc) { - window.addEventListener("load", () => { - console.log("events called!"); - const carouselComponent = document.getElementById("carousel-component"); - console.log("carouselComponent exists!"); - console.log(carouselComponent); - if (carouselComponent) { - console.log(carouselComponent.offsetHeight); - window.parent.postMessage( - { - type: "carouselHeight", - height: carouselComponent.offsetHeight, - }, - "*", - ); - } - }); - } - }, [inDoc]); - const backgroundColor = inDoc ? tamaguiConfig.themes.dark.background.val : tamaguiConfig.themes.light.background.val;