2022-03-22 16:22:41 +05:30
|
|
|
import './ReactI18';
|
2023-11-15 15:33:45 +05:30
|
|
|
import 'styles.scss';
|
2021-08-26 11:50:47 +05:30
|
|
|
|
|
|
|
|
import AppRoutes from 'AppRoutes';
|
2023-01-11 14:39:06 +05:30
|
|
|
import { ThemeProvider } from 'hooks/useDarkMode';
|
2023-11-15 16:46:20 +05:30
|
|
|
import ErrorBoundaryFallback from 'pages/ErrorBoundaryFallback/ErrorBoundaryFallback';
|
2023-01-13 12:01:46 +05:30
|
|
|
import { createRoot } from 'react-dom/client';
|
2023-11-15 16:46:20 +05:30
|
|
|
import { ErrorBoundary } from 'react-error-boundary';
|
2023-08-02 15:14:15 +05:30
|
|
|
import { HelmetProvider } from 'react-helmet-async';
|
2022-04-07 10:48:09 +05:30
|
|
|
import { QueryClient, QueryClientProvider } from 'react-query';
|
2022-06-27 16:33:50 +05:30
|
|
|
import { ReactQueryDevtools } from 'react-query/devtools';
|
2021-08-26 11:50:47 +05:30
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
|
import store from 'store';
|
2021-01-03 18:15:44 +05:30
|
|
|
|
2022-04-08 02:12:54 +05:30
|
|
|
const queryClient = new QueryClient({
|
|
|
|
|
defaultOptions: {
|
|
|
|
|
queries: {
|
|
|
|
|
refetchOnWindowFocus: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
});
|
2022-04-07 10:48:09 +05:30
|
|
|
|
2023-01-13 12:01:46 +05:30
|
|
|
const container = document.getElementById('root');
|
|
|
|
|
|
|
|
|
|
if (container) {
|
|
|
|
|
const root = createRoot(container);
|
|
|
|
|
|
|
|
|
|
root.render(
|
2023-11-15 16:46:20 +05:30
|
|
|
<ErrorBoundary FallbackComponent={ErrorBoundaryFallback}>
|
|
|
|
|
<HelmetProvider>
|
|
|
|
|
<ThemeProvider>
|
|
|
|
|
<QueryClientProvider client={queryClient}>
|
|
|
|
|
<Provider store={store}>
|
|
|
|
|
<AppRoutes />
|
|
|
|
|
</Provider>
|
|
|
|
|
{process.env.NODE_ENV === 'development' && (
|
|
|
|
|
<ReactQueryDevtools initialIsOpen />
|
|
|
|
|
)}
|
|
|
|
|
</QueryClientProvider>
|
|
|
|
|
</ThemeProvider>
|
|
|
|
|
</HelmetProvider>
|
|
|
|
|
,
|
|
|
|
|
</ErrorBoundary>,
|
2023-01-13 12:01:46 +05:30
|
|
|
);
|
|
|
|
|
}
|