22 lines
626 B
TypeScript
22 lines
626 B
TypeScript
|
/* @refresh reload */
|
||
|
import { render } from 'solid-js/web';
|
||
|
|
||
|
import './index.css';
|
||
|
import App from './App';
|
||
|
import { Router, Route } from '@solidjs/router';
|
||
|
import About from './pages/About';
|
||
|
import Switcher from './pages/Switcher';
|
||
|
|
||
|
const root = document.getElementById('root');
|
||
|
|
||
|
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?',
|
||
|
);
|
||
|
}
|
||
|
|
||
|
render(() => <Router root={App}>
|
||
|
<Route path="/about" component={About} />
|
||
|
<Route path="/" component={Switcher} />
|
||
|
</Router>, root!);
|