Attempt to load a second page of data after the first

This commit is contained in:
Jackson Harper 2022-04-06 14:22:41 -07:00
parent 2ef5a59d4c
commit 1402e8b6f8

View file

@ -113,6 +113,14 @@ export function HomeFeedContainer(props: HomeFeedContainerProps): JSX.Element {
setSize(size + 1)
}, [size, isValidating])
useEffect(() => {
console.log('size, hasMore, isValidating', size, hasMore, isValidating)
if (isValidating || !hasMore || size !== 1) {
return
}
setSize(size + 1)
}, [size, isValidating])
const focusFirstItem = useCallback(() => {
if (libraryItems.length < 1) {
return