UseRequestOptions

type UseRequestOptions = object;

Options accepted by useRequest.

Properties

getAbortSignal?

optional getAbortSignal?: () => AbortSignal;

Factory invoked on every attempt (initial fire + every refresh()). The returned signal is attached to that attempt via the underlying store's withSignal(signal).dispatch(), so aborting it cancels just the current attempt.

The most common use is per-attempt timeouts: getAbortSignal: () => AbortSignal.timeout(5000) gives every attempt its own 5-second clock that resets on refresh().

Held in a ref synced to the latest render's closure — there is no need to memoize an inline factory.

Returns

AbortSignal

On this page