Fix infinite scroll trigger
This commit is contained in:
parent
5591635a1e
commit
9570a98168
@ -60,7 +60,7 @@ export default function InfinitePhotoScroll({
|
|||||||
children: (props: {
|
children: (props: {
|
||||||
key: string
|
key: string
|
||||||
photos: Photo[]
|
photos: Photo[]
|
||||||
onLastPhotoVisible: () => void
|
onLastPhotoVisible?: () => void
|
||||||
revalidatePhoto?: RevalidatePhoto
|
revalidatePhoto?: RevalidatePhoto
|
||||||
}) => ReactNode
|
}) => ReactNode
|
||||||
} & PhotoSetCategory) {
|
} & PhotoSetCategory) {
|
||||||
@ -183,7 +183,9 @@ export default function InfinitePhotoScroll({
|
|||||||
children({
|
children({
|
||||||
key: `${cacheKey}-${index}`,
|
key: `${cacheKey}-${index}`,
|
||||||
photos,
|
photos,
|
||||||
onLastPhotoVisible: advance,
|
onLastPhotoVisible: index === data.length - 1
|
||||||
|
? advance
|
||||||
|
: undefined,
|
||||||
revalidatePhoto,
|
revalidatePhoto,
|
||||||
})
|
})
|
||||||
))}
|
))}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user