PaletteSwitcher/palette-switcher-v2/src/index.tsx

22 lines
626 B
TypeScript
Raw Normal View History

2024-01-16 05:44:06 +00:00
/* @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!);