import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; import { BrowserRouter } from 'react-router-dom'; import { App } from './App'; import { AuthProvider } from './auth/auth-context'; import { ToastProvider } from './components/Toast'; import './i18n'; import { ApiError } from './lib/api'; import './styles/tokens.css'; import './styles/base.css'; const queryClient = new QueryClient({ defaultOptions: { queries: { // A 4xx won't turn into something else on retry (wrong permissions, // page in trash, not found, …) — only retry on network/5xx errors. retry: (failureCount, error) => { if (error instanceof ApiError && error.status >= 400 && error.status < 500) return false; return failureCount < 3; }, }, }, }); const container = document.getElementById('root'); if (!container) { throw new Error('index.html is missing the #root element'); } createRoot(container).render( , );