index.tsx
⎇
Raw
1/* @refresh reload */
2import { render } from "solid-js/web";
3import "./style.css";
4
5import App from "./App";
6import { loadDataFromDB } from "./offline";
7
8const root = document.getElementById("root");
9if (!(root instanceof HTMLElement)) {
10 throw new Error(
11 "Root element not found. Did you forget to add it to your index.html? Or maybe the id attribute got misspelled?",
12 );
13}
14loadDataFromDB()
15 .then(() => {
16 root.innerHTML = "";
17 render(() => <App />, root);
18 })
19 .catch((e) => {
20 root.innerHTML = e.toString();
21 });
22