Skip to content

Commit d9b36f6

Browse files
committed
Update useResolvedPath docs
1 parent f8c54a8 commit d9b36f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/hooks/use-resolved-path.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ And then it gets worse if you define the splat route as a child:
6060
<BrowserRouter>
6161
<Routes>
6262
<Route path="/dashboard">
63-
<Route path="*" element={<Dashboard />} />
63+
<Route index path="*" element={<Dashboard />} />
6464
</Route>
6565
</Routes>
6666
</BrowserRouter>
@@ -73,7 +73,7 @@ And then it gets worse if you define the splat route as a child:
7373

7474
When you enable the flag, this "bug" is fixed so that path resolution is consistent across all route types, and `useResolvedPath(".")` always resolves to the current pathname for the contextual route. This includes any dynamic param or splat param values.
7575

76-
If you want to navigate between "sibling" routes within a splat route, it is suggested you move your splat route to it's own child (`<Route path="*" element={<Dashboard />} />`) and use `useResolvedPath("../teams")` and `useResolvedPath("../projects")` parent-relative paths to navigate to sibling routes.
76+
If you want to navigate between "sibling" routes within a splat route, it is suggested you move your splat route to it's own child (`<Route index path="*" element={<Dashboard />} />`) and use `useResolvedPath("../teams")` and `useResolvedPath("../projects")` parent-relative paths to navigate to sibling `/dashboard` routes.
7777

7878
[navlink]: ../components/nav-link
7979
[resolvepath]: ../utils/resolve-path

0 commit comments

Comments
 (0)