From 55749a95658f605bd2912c7d233073f6e490007e Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Sun, 4 Aug 2024 17:28:04 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F(frontend)=20extract=20queryC?= =?UTF-8?q?lient=20definition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It will be necessary to access the client in other components for manually discarding or setting data in the central data store. --- src/frontend/src/App.tsx | 4 ++-- src/frontend/src/api/queryClient.ts | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 src/frontend/src/api/queryClient.ts diff --git a/src/frontend/src/App.tsx b/src/frontend/src/App.tsx index aab0ef18..9badb528 100644 --- a/src/frontend/src/App.tsx +++ b/src/frontend/src/App.tsx @@ -2,7 +2,7 @@ import '@livekit/components-styles' import '@/styles/index.css' import { Suspense } from 'react' import { ReactQueryDevtools } from '@tanstack/react-query-devtools' -import { QueryClient, QueryClientProvider } from '@tanstack/react-query' +import { QueryClientProvider } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' import { useLang } from 'hoofd' import { Switch, Route } from 'wouter' @@ -11,8 +11,8 @@ import { NotFoundScreen } from './components/NotFoundScreen' import { routes } from './routes' import './i18n/init' import { silenceLiveKitLogs } from "@/utils/livekit.ts"; +import { queryClient } from "@/api/queryClient"; -const queryClient = new QueryClient() function App() { const { i18n } = useTranslation() diff --git a/src/frontend/src/api/queryClient.ts b/src/frontend/src/api/queryClient.ts new file mode 100644 index 00000000..d689336f --- /dev/null +++ b/src/frontend/src/api/queryClient.ts @@ -0,0 +1,3 @@ +import { QueryClient } from "@tanstack/react-query"; + +export const queryClient = new QueryClient()