Skip to content

Commit

Permalink
Add QueryClientProvider to key application components
Browse files Browse the repository at this point in the history
  • Loading branch information
ost-ptk committed Nov 22, 2024
1 parent f9fc016 commit e6332d2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions src/apps/import-account-with-file/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { QueryClientProvider } from '@tanstack/react-query';
import React, { Suspense, useState } from 'react';
import { createRoot } from 'react-dom/client';
import { Provider as ReduxProvider } from 'react-redux';
Expand All @@ -18,6 +19,7 @@ import { useSystemThemeDetector } from '@hooks/use-system-theme-detector';

import '@libs/i18n/i18n';
import { ErrorBoundary } from '@libs/layout';
import { newQueryClient } from '@libs/services/query-client';
import { GlobalStyle, darkTheme, lightTheme } from '@libs/ui';

import { AppRouter } from './app-router';
Expand Down Expand Up @@ -57,9 +59,11 @@ const Tree = () => {
<ThemeProvider theme={isDarkMode ? darkTheme : lightTheme}>
<GlobalStyle />
<ReduxProvider store={store}>
<ErrorBoundary>
<AppRouter />
</ErrorBoundary>
<QueryClientProvider client={newQueryClient}>
<ErrorBoundary>
<AppRouter />
</ErrorBoundary>
</QueryClientProvider>
</ReduxProvider>
</ThemeProvider>
</Suspense>
Expand Down
10 changes: 7 additions & 3 deletions src/apps/signature-request/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { QueryClientProvider } from '@tanstack/react-query';
import React, { Suspense, useState } from 'react';
import { createRoot } from 'react-dom/client';
import { Provider as ReduxProvider } from 'react-redux/es/exports';
Expand All @@ -18,6 +19,7 @@ import { useSystemThemeDetector } from '@hooks/use-system-theme-detector';

import '@libs/i18n/i18n';
import { ErrorBoundary } from '@libs/layout';
import { newQueryClient } from '@libs/services/query-client';
import { GlobalStyle, darkTheme, lightTheme } from '@libs/ui';

import { AppRouter } from './app-router';
Expand Down Expand Up @@ -59,9 +61,11 @@ const Tree = () => {
<ThemeProvider theme={isDarkMode ? darkTheme : lightTheme}>
<GlobalStyle />
<ReduxProvider store={store}>
<ErrorBoundary>
<AppRouter />
</ErrorBoundary>
<QueryClientProvider client={newQueryClient}>
<ErrorBoundary>
<AppRouter />
</ErrorBoundary>
</QueryClientProvider>
</ReduxProvider>
</ThemeProvider>
</Suspense>
Expand Down

0 comments on commit e6332d2

Please sign in to comment.