import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'

import { App } from './App'
import { applyStoredTheme } from './lib/useTheme'
import './index.css'

// Before the first render, not in an effect. An effect runs after the first
// paint, so somebody who has chosen dark would get a full frame of white first
// - which reads as a fault rather than as a preference being applied.
applyStoredTheme()

createRoot(document.getElementById('root')!).render(
  <StrictMode>
    <App />
  </StrictMode>,
)
