diff --git a/ts-router/src/app.tsx b/ts-router/src/app.tsx index 4567a32..f76e7ea 100644 --- a/ts-router/src/app.tsx +++ b/ts-router/src/app.tsx @@ -1,8 +1,11 @@ import { Component } from "solid-js"; -import { Link, Route, useRouter } from "solid-app-router"; +import { Link, useRoutes, useLocation } from "solid-app-router"; + +import { routes } from "./routes"; const App: Component = () => { - const [router] = useRouter(); + const location = useLocation(); + const Route = useRoutes(routes); return ( <> @@ -30,7 +33,7 @@ const App: Component = () => { class="w-75px p-1 bg-white text-sm rounded-lg" type="text" readOnly - value={router.location} + value={location.pathname} /> diff --git a/ts-router/src/index.tsx b/ts-router/src/index.tsx index e1b308c..a864b1d 100644 --- a/ts-router/src/index.tsx +++ b/ts-router/src/index.tsx @@ -2,12 +2,11 @@ import "windi.css"; import { render } from "solid-js/web"; import { Router } from "solid-app-router"; -import { routes } from "./routes"; import App from "./app"; render( () => ( - + ),