MainLayout for theme persistence

This commit is contained in:
Sean Edmunds
2025-01-17 11:33:30 -06:00
parent f49895dee9
commit e7f5e94ed6
13 changed files with 150 additions and 77 deletions

View File

@@ -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);
});