PaletteSwitcher/palette-switcher-v2/src/index.tsx
2024-01-16 06:44:06 +01:00

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!);