/** * A hook that provides a way to fetch data with loading and error states. * Automatically handles the fetch lifecycle and provides a clean API. * * @param url - The URL to fetch from * @param options - Optional fetch options * @returns An object with data, loading state, error state, and refetch function * * @example * ```tsx * const { data, loading, error, refetch } = useFetch('/api/users') * * if (loading) return
Loading...
* if (error) return
Error: {error.message}
* * return ( *
* {data?.map(user => )} * *
* ) * ``` */ export declare function useFetch(url: string, options?: RequestInit): { data: T | null; loading: boolean; error: Error | null; refetch: () => void; }; //# sourceMappingURL=useFetch.d.ts.map