From 846cc64025cba17c0b9f29fe10c71188ee5ed648 Mon Sep 17 00:00:00 2001 From: Caspian Zhao Date: Sat, 5 Oct 2024 10:29:13 +0800 Subject: [PATCH] fix: demo app can't be displayed in doc site. (#695) --- example/app/app/+html.tsx | 6 ------ example/app/app/_layout.tsx | 11 ++++++++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/example/app/app/+html.tsx b/example/app/app/+html.tsx index a88a856..36009d8 100644 --- a/example/app/app/+html.tsx +++ b/example/app/app/+html.tsx @@ -16,12 +16,6 @@ export default function Root({ children }: { children: React.ReactNode }) { content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1" /> - {/* This CSP used to control which domain could embed this App. For now, we're using this App in doc site. */} - - {/* Disable body scrolling on web. This makes ScrollView components work closer to how they do on native. However, body scrolling is often nice to have for mobile web. If you want to enable it, remove this line. diff --git a/example/app/app/_layout.tsx b/example/app/app/_layout.tsx index a4d1dbb..d15caa1 100644 --- a/example/app/app/_layout.tsx +++ b/example/app/app/_layout.tsx @@ -58,10 +58,19 @@ function RootLayoutNav() { 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(