| 1 | // oxlint-disable import/no-unassigned-import |
| 2 | /* @refresh reload */ |
| 3 | import "solid-devtools"; |
| 4 | import "./index.css"; |
| 5 | |
| 6 | import { render } from "solid-js/web"; |
| 7 | |
| 8 | import { Router } from "@solidjs/router"; |
| 9 | import App from "./app"; |
| 10 | import { routes } from "./routes"; |
| 11 | |
| 12 | const root = document.getElementById("root"); |
| 13 | |
| 14 | if (import.meta.env.DEV && !(root instanceof HTMLElement)) { |
| 15 | throw new Error( |
| 16 | "Root element not found. Did you forget to add it to your index.html? Or maybe the id attribute got misspelled?", |
| 17 | ); |
| 18 | } |
| 19 | |
| 20 | render( |
| 21 | () => <Router root={(props) => <App>{props.children}</App>}>{routes}</Router>, |
| 22 | root, |
| 23 | ); |