MainLayout for theme persistence
This commit is contained in:
29
src/main.tsx
29
src/main.tsx
@@ -1,21 +1,10 @@
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import App from './App.tsx';
|
||||
import App from './App';
|
||||
import render from './Root';
|
||||
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
gcTime: 1000 * 60 * 60 * 24, // 24 hours
|
||||
staleTime: 1000 * 60 * 1, // 1 min
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
||||
<React.StrictMode>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<App />
|
||||
</QueryClientProvider>
|
||||
</React.StrictMode>,
|
||||
);
|
||||
Promise.all([render, App])
|
||||
.then(([render, App]) => {
|
||||
render(App);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error loading the app:', error);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user