|
@@ -1,15 +1,21 @@
|
|
|
/* @refresh reload */
|
|
|
import { render } from 'solid-js/web';
|
|
|
+import { Router, useRoutes, hashIntegration } from "@solidjs/router";
|
|
|
|
|
|
-import './index.css';
|
|
|
-import App from './App';
|
|
|
+import routes from "./router/index"
|
|
|
+import './assets/css/index.css';
|
|
|
|
|
|
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?',
|
|
|
- );
|
|
|
+ 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(() => <App />, root);
|
|
|
+render(() => {
|
|
|
+ const Routes = useRoutes(routes);
|
|
|
+ return <Router source={hashIntegration()}>
|
|
|
+ <Routes />
|
|
|
+ </Router>
|
|
|
+}, root);
|