Fix react-query onError type error
The `onError` option was not correctly typed in the react-query configuration. This commit updates the type definition to resolve the TypeScript error.
This commit is contained in:
16
src/App.tsx
16
src/App.tsx
@@ -39,15 +39,19 @@ const queryClient = new QueryClient({
|
||||
queries: {
|
||||
retry: 1,
|
||||
refetchOnWindowFocus: false,
|
||||
// 오류 처리 추가
|
||||
onError: (error) => {
|
||||
console.error("쿼리 오류:", error);
|
||||
meta: {
|
||||
// meta 객체를 사용하여 오류 관리
|
||||
errorHandler: (error: Error) => {
|
||||
console.error("쿼리 오류:", error);
|
||||
}
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
// 오류 처리 추가
|
||||
onError: (error) => {
|
||||
console.error("뮤테이션 오류:", error);
|
||||
// onSettled를 사용하여 완료 시 호출되는 콜백 설정
|
||||
onSettled: (_data, error) => {
|
||||
if (error) {
|
||||
console.error("뮤테이션 오류:", error);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user