From 6b4c6a6352dbf98dac6d114ff351f557a7f96003 Mon Sep 17 00:00:00 2001 From: Chris Williams Date: Sat, 21 Dec 2024 14:06:38 -0800 Subject: [PATCH] back to useEffect --- packages/visx-demo/src/components/GalleryTile.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/visx-demo/src/components/GalleryTile.tsx b/packages/visx-demo/src/components/GalleryTile.tsx index 8b5aecfb6..10b64acd8 100644 --- a/packages/visx-demo/src/components/GalleryTile.tsx +++ b/packages/visx-demo/src/components/GalleryTile.tsx @@ -48,6 +48,7 @@ function useEverVisible() { return () => { if (curr) { observer.unobserve(curr); + observer.disconnect(); } }; }, []); @@ -72,6 +73,7 @@ export default function GalleryTile({ exampleUrl,
+ {/** lazy render */} {everVisible && ( {({ width, height }) =>