You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
461 B
JavaScript
24 lines
461 B
JavaScript
import { Router, route } from 'preact-router'
|
|
import { render } from 'preact'
|
|
import { useEffect } from 'preact/hooks'
|
|
import { PageHomepage } from './pages.jsx'
|
|
|
|
const Redirect = ({ to }) => {
|
|
useEffect(() => {
|
|
route(to, true)
|
|
}, [])
|
|
|
|
return null
|
|
}
|
|
|
|
const Main = ({}) => {
|
|
return (
|
|
<Router>
|
|
<PageHomepage path="/" />
|
|
<Redirect default to="/" />
|
|
</Router>
|
|
)
|
|
}
|
|
|
|
render(<Main />, document.body)
|