Sanity Library Reference Docs
    Preparing search index...

    Interface PagedFetcherHookResult<TPage>

    The value returned by a hook that reads a list a page at a time, like useApplications. data is one page holding every item read so far, in order, with the last page's nextCursor.

    interface PagedFetcherHookResult<TPage> {
        data: TPage;
        error: unknown;
        hasMore: boolean;
        isFetching: boolean;
        isPending: boolean;
        loadMore: () => void;
        refetch: () => Promise<TPage>;
    }

    Type Parameters

    • TPage

    Hierarchy (View Summary)

    Index

    Properties

    data: TPage

    The resolved data. Guaranteed present — the hook suspends until the first fetch succeeds.

    error: unknown

    The most recent background-fetch failure while data still renders; cleared by the next success.

    hasMore: boolean

    Whether there's another page to read.

    isFetching: boolean

    A fetch for this entry is in flight (background revalidation or a refetch()).

    isPending: boolean

    Whether the next page is being read.

    loadMore: () => void

    Reads the next page. A failure shows on error, keeping the items read so far.

    refetch: () => Promise<TPage>

    Imperatively refetch, bypassing staleness. Resolves with the refreshed data.