main.tsx 640 B

1234567891011121314151617181920
  1. import { StrictMode } from 'react'
  2. import { createRoot } from 'react-dom/client'
  3. import './index.css'
  4. import { i18nReady } from './i18n'
  5. import App from './App.tsx'
  6. // Only English is bundled (#3175). Wait for the language in use, so the first
  7. // paint is not English or raw keys; a slow network gets English after 3 s and
  8. // switches when the file arrives.
  9. const LANGUAGE_WAIT_MS = 3000
  10. Promise.race([i18nReady, new Promise((resolve) => setTimeout(resolve, LANGUAGE_WAIT_MS))])
  11. .catch(() => {})
  12. .then(() => {
  13. createRoot(document.getElementById('root')!).render(
  14. <StrictMode>
  15. <App />
  16. </StrictMode>,
  17. )
  18. })