Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: install react query devtools #1081

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/react-query.provider.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
'use client'

import { isDev } from '@/lib/config/app.config'
import { captureError } from '@/lib/shared/utils/errors'
import { SentryMetadata, captureSentryError, shouldIgnore } from '@/lib/shared/utils/query-errors'
import { QueryCache, QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
import { ReactNode } from 'react'

export const queryClient = new QueryClient({
Expand Down Expand Up @@ -38,5 +40,11 @@ queryClient.setDefaultOptions({
})

export function ReactQueryClientProvider({ children }: { children: ReactNode | ReactNode[] }) {
return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
const shouldShowReactQueryDevtools = false
return (
<QueryClientProvider client={queryClient}>
{children}
{isDev && shouldShowReactQueryDevtools && <ReactQueryDevtools initialIsOpen={false} />}
</QueryClientProvider>
)
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"@sentry/nextjs": "^8.13.0",
"@studio-freight/react-lenis": "^0.0.47",
"@tanstack/react-query": "^5.29.2",
"@tanstack/react-query-devtools": "^5.56.0",
"@tanstack/react-table": "^8.9.3",
"@vercel/speed-insights": "^1.0.1",
"bignumber.js": "^9.1.2",
Expand Down
20 changes: 20 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading