Sanity Library Reference Docs
    Preparing search index...

    Interface FetcherHookResult<TData>

    The value returned by a fetcher-backed hook. The hook suspends until the first fetch succeeds, so data is always present once your component renders.

    interface FetcherHookResult<TData> {
        data: TData;
        error: unknown;
        isFetching: boolean;
        refetch: () => Promise<TData>;
    }

    Type Parameters

    • TData
    Index

    Properties

    data: TData

    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.

    isFetching: boolean

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

    refetch: () => Promise<TData>

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