import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import { App } from './App'
import './styles/index.css'

const rootEl = document.getElementById('root')!

createRoot(rootEl).render(
  <StrictMode>
    <App />
  </StrictMode>,
)

// Double rAF: wait for the initial (opacity: 0) frame to actually paint
// before adding the class that fades it in — otherwise there's nothing to
// transition from and it still just pops in.
requestAnimationFrame(() => {
  requestAnimationFrame(() => rootEl.classList.add('is-ready'))
})
