import { useState, useRef, useEffect } from 'react' import { createRoot } from 'react-dom/client' import Layout from '@public/layouts' function App() { const [showForm, setShowForm] = useState(false) const inputRef = useRef(null) useEffect(() => { if (showForm) { setTimeout(() => inputRef.current?.focus(), 500) } }, [showForm]) return ( <> ) } const root = createRoot(document.getElementById('elysia')!) root.render( )