switch to react location for routing

This commit is contained in:
MapleLeaf
2021-12-31 15:48:57 -06:00
committed by Darius
parent f603bdd7ba
commit e64d3cbdfd
7 changed files with 96 additions and 29 deletions

View File

@@ -0,0 +1,21 @@
import type { Route } from "react-location"
export const routes: Route[] = [
{
path: "/",
element: () =>
import("./pages/landing-page").then((m) => <m.LandingPage />),
},
{
path: "docs",
element: () =>
import("./pages/document-page").then((m) => <m.DocumentPage />),
children: [
{
path: "*",
element: ({ params }) =>
import(`./docs/${params["*"]}.md`).then((m) => <m.default />),
},
],
},
]