// Main file
import { lazy } from "solid-js";
import { render } from "solid-js/web";
import { Router } from "@solidjs/router";
import { AuthProvider } from "./context/auth-context";
const wrapper = document.getElementById("root");
if (!wrapper) {
throw new Error("Wrapper div not found");
}
const routes = [
{
path: "/dashboard",
component: lazy(() => import("~/routes/dashboard/layout")), // Is it the correct way
children: [
{
path: "",
component: lazy(() => import("~/routes/dashboard/index")),
},
],
}
];
render(
() => (
<AuthProvider>
<Router>{routes}</Router>
</AuthProvider>
),
wrapper,
);
// Main file
import { lazy } from "solid-js";
import { render } from "solid-js/web";
import { Router } from "@solidjs/router";
import { AuthProvider } from "./context/auth-context";
const wrapper = document.getElementById("root");
if (!wrapper) {
throw new Error("Wrapper div not found");
}
const routes = [
{
path: "/dashboard",
component: lazy(() => import("~/routes/dashboard/layout")), // Is it the correct way
children: [
{
path: "",
component: lazy(() => import("~/routes/dashboard/index")),
},
],
}
];
render(
() => (
<AuthProvider>
<Router>{routes}</Router>
</AuthProvider>
),
wrapper,
);