fix(query-core): abort fetch loop for infinite queries if getNextPageParam returns null or undefined (#7799)
The `fetchPage` function has a safeguard where it only returns the current data if pageParam == null, however, this means we still stay in the loop and call `getNextPageParam` unnecessarily. This can be troublesome if you set `pages: Infinity` on queryClient.fetchInfiniteQuery to fetch an arbitrary amount of pages until the natural end is reached by returning null/undefined from getNextPageParam, because it would never actually escape the loop
D
Dominik Dorfmeister committed
3ef788786c2275cda14f6c0b0cd2216f4164d82c
Parent: 34a5672
Committed by GitHub <noreply@github.com>
on 7/26/2024, 8:44:32 AM