File size: 520 Bytes
219639b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { StrictMode, useEffect, useState } from 'react'
import { initializeI18n } from '@/i18n'
import App from '@/App'

export const Root = () => {
  const [isI18nInitialized, setIsI18nInitialized] = useState(false)

  useEffect(() => {
    // Initialize i18n immediately with persisted language
    initializeI18n().then(() => {
      setIsI18nInitialized(true)
    })
  }, [])

  if (!isI18nInitialized) {
    return null // or a loading spinner
  }

  return (
    <StrictMode>
      <App />
    </StrictMode>
  )
}