import React from 'react' import { createRoot } from 'react-dom/client' import App from './App.jsx' import Home from './Home.jsx' import './styles.css' // Two routes, no router: '/' is the marketing page, '/app' is the builder. function Root() { const [path, setPath] = React.useState(window.location.pathname) React.useEffect(() => { const onPop = () => setPath(window.location.pathname) window.addEventListener('popstate', onPop) return () => window.removeEventListener('popstate', onPop) }, []) const nav = (to) => { window.history.pushState({}, '', to) setPath(to) window.scrollTo(0, 0) } return path.startsWith('/app') ? nav('/')} /> : nav('/app')} /> } createRoot(document.getElementById('root')).render( )