Skip to content

Commit da1e70b

Browse files
committed
bug
1 parent 7f93bc5 commit da1e70b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

playground/app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const App = (): JSX.Element => {
5454

5555
<Routes>
5656
<Route path="/:user/:repl" element={<Edit dark={dark()} />} />
57-
<Route path="/:id" element={<Home />} />
57+
<Route path="/:user" element={<Home />} />
5858
<Route path="/" element={<Home />} />
5959
<Route path="/login" element={<Login />} />
6060
</Routes>

playground/pages/home.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useNavigate, useRouteData } from 'solid-app-router';
1+
import { useNavigate, useParams } from 'solid-app-router';
22
import { Icon } from 'solid-heroicons';
33
import { eye, eyeOff, plus, x } from 'solid-heroicons/outline';
44
import { createResource, For } from 'solid-js';
@@ -21,11 +21,10 @@ interface Repls {
2121
}
2222

2323
export const Home = () => {
24-
const routeUser = useRouteData();
24+
const params = useParams();
2525
const context = useAppContext()!;
2626
const navigate = useNavigate();
27-
28-
const user = () => routeUser || context.user()?.display;
27+
const user = () => params.user || context.user()?.display;
2928

3029
const [repls] = createResource(user, async (user) => {
3130
if (!user) return { total: 0, list: [] };

0 commit comments

Comments
 (0)