const [queryClient] = useState(
() =>
new QueryClient({
queryCache: new QueryCache({
onError: (error) => {
// "error" is of type Error but I need AxiosError
},
}),
mutationCache: new MutationCache({
onError: (error) => {
// Same here, "error" has to be type of AxiosError
},
}),
defaultOptions: {
queries: {
staleTime: 10 * 60 * 1000,
},
},
}),
);
const [queryClient] = useState(
() =>
new QueryClient({
queryCache: new QueryCache({
onError: (error) => {
// "error" is of type Error but I need AxiosError
},
}),
mutationCache: new MutationCache({
onError: (error) => {
// Same here, "error" has to be type of AxiosError
},
}),
defaultOptions: {
queries: {
staleTime: 10 * 60 * 1000,
},
},
}),
);