Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs]: description of relative link behavior is incorrect for index routes #12122

Open
max-dekock opened this issue Oct 11, 2024 · 1 comment
Labels

Comments

@max-dekock
Copy link

Describe what's incorrect/missing in the documentation

In the Link documentation, relative paths are explained thusly:

By default, links are relative to the route hierarchy (relative="route"), so .. will go up one Route level from the current contextual route.

This description is incorrect, as it doesn't account for the fact that index routes (and any routes that don't add to the path) are passed over.

I had some routes that looked something like this:

<Route path="module">
  <Route index element={<FeatureA/>}/>
  <Route path="feature-a" element={<FeatureA/>}/>
  <Route path="feature-b" element={<FeatureB/>}/>
  {...}
 </Route>

I expected that relative links in the index route would work the same as in the feature-a path. I was confused why they were broken, until I stumbled upon issue #8350 and realized that there was an undocumented change making index routes behave differently.

The documentation should be changed to reflect this behavior.

@OlegDev1
Copy link
Contributor

Thank you for noticing this issue! I have added the missing part

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants