Skip to content

Commit

Permalink
chore: Optimize lazy loading for images in MediaContent component
Browse files Browse the repository at this point in the history
  • Loading branch information
Vette1123 committed Sep 1, 2024
1 parent d24515c commit 73effac
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/media/media-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export const MediaContent = ({
getPopularMediaAction,
queryKey,
}: MediaContentProps) => {
const [myRef, inView] = useInView()
const [myRef, inView] = useInView({
threshold: 0,
rootMargin: '0px 0px 200px 0px',
})
const { data, fetchNextPage } = useInfiniteScroll({
media,
popularMediaAction: getPopularMediaAction,
Expand Down

0 comments on commit 73effac

Please sign in to comment.