TanStack
API Reference

UseSuspenseInfiniteQueryOptions

Defined in: packages/react-query/src/types.ts:271

The options accepted by useSuspenseInfiniteQuery. Same as UseInfiniteQueryOptions, minus enabled, throwOnError, and placeholderData — Suspense hooks cannot render a "disabled" or "placeholder" state, so those options don't apply.

Extends

Type Parameters

TQueryFnData

TQueryFnData = unknown

The type of a single page, as your queryFn resolves it.

TError

TError = DefaultError

The type of errors your queryFn may throw.

TData

TData = InfiniteData<TQueryFnData>

The type data ends up as after select runs — defaults to InfiniteData<TQueryFnData>, the shape of all fetched pages plus their page params.

TQueryKey

TQueryKey extends QueryKey = QueryKey

The type of your queryKey.

TPageParam

TPageParam = unknown

The type of the parameter passed to queryFn to fetch a given page.

Properties

PropertyTypeDefault valueDescription
gcTime?numberundefinedThe time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to Infinity will disable garbage collection. Defaults to 5 * 60 * 1000 (5 minutes), or Infinity during SSR. Note: the maximum allowed time is about 24 days, imposed by setTimeout's 32-bit signed integer delay — see timeoutManager.setTimeoutProvider for a workaround.
getNextPageParam(lastPage: TQueryFnData, allPages: TQueryFnData[], lastPageParam: TPageParam, allPageParams: TPageParam[]) => TPageParam |