T
TanStack3y ago
vicious-gold

useInfiniteQuery update

Hello guys! I can't understand how to use useInfiniteQuery() in this version.
const { data, fetchNextPage, hasNextPage, isFetchingNextPage, status } =
useInfiniteQuery({
queryKey: [queryKey, paramValue],
queryFn: fetchMessages,
getNextPageParam: (lastPage) => lastPage?.nextCursor,
refetchInterval: isConnected ? false : 1000,
initialPageParam: 1,
});
const { data, fetchNextPage, hasNextPage, isFetchingNextPage, status } =
useInfiniteQuery({
queryKey: [queryKey, paramValue],
queryFn: fetchMessages,
getNextPageParam: (lastPage) => lastPage?.nextCursor,
refetchInterval: isConnected ? false : 1000,
initialPageParam: 1,
});
in the last year's version
initialPageParam
initialPageParam
was not a Required parameter.
1 Reply
genetic-orange
genetic-orange3y ago

Did you find this page helpful?