🔧 Update router to latest API

This commit is contained in:
Alexandre Mouton-Brady
2021-07-30 19:17:56 +02:00
parent 4a68c43c35
commit e57036fa65
2 changed files with 7 additions and 5 deletions
+6 -3
View File
@@ -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}
/>
</li>
</ul>
+1 -2
View File
@@ -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(
() => (
<Router routes={routes}>
<Router>
<App />
</Router>
),