mirror of
https://github.com/neosubhamoy/neodlp.git
synced 2026-02-04 17:42:22 +05:30
refactor: added errored state and improved error detection
This commit is contained in:
@@ -3,13 +3,22 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
|
||||
|
||||
const TanstackProvider = ({children}: {children: React.ReactNode}) => {
|
||||
const queryClient = new QueryClient();
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>
|
||||
{children}
|
||||
<ReactQueryDevtools initialIsOpen={false} />
|
||||
</QueryClientProvider>
|
||||
)
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
networkMode: 'always',
|
||||
},
|
||||
mutations: {
|
||||
networkMode: 'always',
|
||||
}
|
||||
}
|
||||
});
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>
|
||||
{children}
|
||||
<ReactQueryDevtools initialIsOpen={false} />
|
||||
</QueryClientProvider>
|
||||
)
|
||||
}
|
||||
|
||||
export default TanstackProvider
|
||||
export default TanstackProvider
|
||||
|
||||
Reference in New Issue
Block a user