Open
Description
// api/instance.ts
import ky, { type BeforeRequestHook, type BeforeRetryHook } from 'ky'
const beforeRetryHook: BeforeRetryHook = ({
request,
options,
error,
retryCount,
}) => {
console.log('test', error) // This error is not being logged
}
const api = ky.create({
prefixUrl: 'https://api.example.com',
headers: {
'Content-Type': 'application/json',
},
hooks: {
beforeRetry: [beforeRetryHook],
},
})
// Using with React Query
// provider/QueryProvider.tsx
const queryClient = new QueryClient({
defaultOptions: {
queries: {},
mutations: {},
},
})
I'm experiencing an issue where the error parameter in the beforeRetry hook is not being logged to the console. I'm using ky with React Query in a React Native (Expo) application.
Metadata
Metadata
Assignees
Labels
No labels