Fixed routing
This commit is contained in:
parent
9f60c27b60
commit
a271bdc64e
9 changed files with 55 additions and 57 deletions
13
src/index.tsx
Normal file
13
src/index.tsx
Normal 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue