@mantine/hooks
Version:
A collection of 50+ hooks for state and UI management
11 lines (10 loc) • 319 B
TypeScript
export interface UseFetchOptions extends RequestInit {
autoInvoke?: boolean;
}
export declare function useFetch<T>(url: string, { autoInvoke, ...options }?: UseFetchOptions): {
data: T | null;
loading: boolean;
error: Error | null;
refetch: () => Promise<any> | undefined;
abort: () => void;
};