forked from remix-run/react-router
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix relative=path issue (remix-run#11006)
- Loading branch information
1 parent
087a4aa
commit 67c3ca8
Showing
5 changed files
with
70 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
"@remix-run/router": patch | ||
--- | ||
|
||
Fix `relative="path"` bug where relative path calculations started from the full location pathname, instead of from the current contextual route pathname. | ||
|
||
```jsx | ||
<Route path="/a"> | ||
<Route path="/b" element={<Component />}> | ||
<Route path="/c" /> | ||
</Route> | ||
</Route>; | ||
|
||
function Component() { | ||
return ( | ||
<> | ||
{/* This is now correctly relative to /a/b, not /a/b/c */} | ||
<Link to=".." relative="path" /> | ||
<Outlet /> | ||
</> | ||
); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters