From 46c005695b040782687d38219c1e2f6fae3f159a Mon Sep 17 00:00:00 2001 From: Fran Dios Date: Tue, 29 Nov 2022 14:53:00 +0900 Subject: [PATCH 1/2] Fix terminal warnings about Image withtout altText --- templates/demo-store/app/components/Hero.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/demo-store/app/components/Hero.tsx b/templates/demo-store/app/components/Hero.tsx index 57d1c183fe..c66dfb5ab9 100644 --- a/templates/demo-store/app/components/Hero.tsx +++ b/templates/demo-store/app/components/Hero.tsx @@ -42,7 +42,7 @@ export function Hero({ >
{spread?.reference && ( -
+
Date: Tue, 29 Nov 2022 16:37:31 +0900 Subject: [PATCH 2/2] Try to fix hydration errors --- .../app/components/CountrySelector.tsx | 7 ++++++- templates/demo-store/app/components/Layout.tsx | 17 +++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/templates/demo-store/app/components/CountrySelector.tsx b/templates/demo-store/app/components/CountrySelector.tsx index f99184ea12..8238d5f5fe 100644 --- a/templates/demo-store/app/components/CountrySelector.tsx +++ b/templates/demo-store/app/components/CountrySelector.tsx @@ -28,6 +28,11 @@ export function CountrySelector() { triggerOnce: true, }); + const observerRef = useRef(null); + useEffect(() => { + ref(observerRef.current); + }, [ref, observerRef]); + // Get available countries list when in view useEffect(() => { if (!inView || fetcher.data || fetcher.state === 'loading') return; @@ -40,7 +45,7 @@ export function CountrySelector() { return (
diff --git a/templates/demo-store/app/components/Layout.tsx b/templates/demo-store/app/components/Layout.tsx index 302d6ba2e5..271750d843 100644 --- a/templates/demo-store/app/components/Layout.tsx +++ b/templates/demo-store/app/components/Layout.tsx @@ -470,14 +470,15 @@ function FooterMenu({menu}: {menu?: EnhancedMenu}) { open ? `max-h-48 h-fit` : `max-h-0 md:max-h-fit` } overflow-hidden transition-all duration-300`} > - {/* @todo: the `static` prop causes a Suspense warning */} - - - + + + + +
) : null}