TanStackT
TanStack2mo ago
5 replies
dangerous-fuchsia

Infinite query's fetchNextPage manual hasNextPage check

Hi,

I was wondering why fetchNextPage doesn't automatically check if there is a next page to fetch.

For example the docs give this example. I get why isFetching is not automatically checked but I can't find any logical reason for the hasNextPage not automatically be included in the fetchNextPage.
 ts
<List onEndReached={() => hasNextPage && !isFetching && fetchNextPage()} />


Anyone have some insights on why?

Thanks in advance!
Was this page helpful?