Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
chore: install react query devtools (#1081)
Browse files Browse the repository at this point in the history
  • Loading branch information
agualis authored Sep 13, 2024
1 parent f002c4b commit 811e13c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
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 All @@ -25,5 +27,11 @@ export const queryClient = new QueryClient({
})

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.

0 comments on commit 811e13c

Please sign in to comment.