Skip to content

Commit

Permalink
back to useEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
williaster committed Dec 21, 2024
1 parent 4921403 commit 6b4c6a6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/visx-demo/src/components/GalleryTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function useEverVisible() {
return () => {
if (curr) {
observer.unobserve(curr);
observer.disconnect();
}
};
}, []);
Expand All @@ -72,6 +73,7 @@ export default function GalleryTile<ExampleProps extends WidthAndHeight>({
exampleUrl,
<div ref={ref} className="gallery-tile" style={tileStyles}>
<div className="image">
{/** lazy render */}
{everVisible && (
<ParentSize>
{({ width, height }) =>
Expand Down

0 comments on commit 6b4c6a6

Please sign in to comment.