Fixed routing

This commit is contained in:
Patrick Alvin Alcala 2025-09-25 09:22:32 +08:00
parent 9f60c27b60
commit a271bdc64e
9 changed files with 55 additions and 57 deletions

13
src/index.tsx Normal file
View file

@ -0,0 +1,13 @@
import './index.sass'
import { render } from 'solid-js/web'
import { Router } from '@solidjs/router'
import { routes } from './routes'
import App from './app.tsx'
const root = document.getElementById('root') as HTMLElement
if (import.meta.env.DEV && !(root instanceof HTMLElement)) {
throw new Error('Root element not found. Did you forget to add it to your index.html? Or maybe the id attribute got misspelled?')
}
// @ts-ignore
render(() => <Router root={(props) => <App>{props.children}</App>}>{routes}</Router>, root)