Skip to content

Commit

Permalink
Clarify relative="path" docs
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Dec 6, 2023
1 parent 426b055 commit c47464c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/components/link.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ A relative `<Link to>` value (that does not begin with `/`) resolves relative to

## `relative`

By default, links are relative to the route hierarchy (`relative="route"`), so `..` will go up one `Route` level. Occasionally, you may find that you have matching URL patterns that do not make sense to be nested, and you'd prefer to use relative _path_ routing. You can opt into this behavior with `relative="path"`:
By default, links are relative to the route hierarchy (`relative="route"`), so `..` will go up one `Route` level from the current contextual route. Occasionally, you may find that you have matching URL patterns that do not make sense to be nested, and you'd prefer to use relative _path_ routing from the current contextual route path. You can opt into this behavior with `relative="path"`:

```jsx
// Contact and EditContact do not share additional UI layout
Expand All @@ -79,7 +79,8 @@ By default, links are relative to the route hierarchy (`relative="route"`), so `

function EditContact() {
// Since Contact is not a parent of EditContact we need to go up one level
// in the path, instead of one level in the Route hierarchy
// in the current contextual route path, instead of one level in the Route
// hierarchy
return (
<Link to=".." relative="path">
Cancel
Expand Down

0 comments on commit c47464c

Please sign in to comment.