Closed kentcdodds closed 1 year ago
Fixed by #11006 - will be available in the next release 👍
🤖 Hello there,
We just published version 6.19.0-pre.0
which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!
Thanks!
🤖 Hello there,
We just published version 6.19.0
which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!
Thanks!
I've verified this is working. Thank you!
I expect to be able to use relative="path" and have that be relative to the path of the route I'm rendering within. As @ryanflorence said:
It should be relative to the “route in context” path, not the url
I think that the documentation is a bit ambiguous on this point:
By default, links are relative to the route hierarchy (
relative="route"
), so..
will go up oneRoute
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 withrelative="path"
:
Would it be possible to update the docs to clarify that relative="path"
routing is relative to the path of the current route module, not the full path of the current URL?
@lpsinger Thanks for the call out - I just updated the docs to be a bit clearer in c47464c7e51c38cdf21a9fc2db81248daee2d171
What version of Remix are you using?
2.2.0
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
Open
http://localhost:3000/users/kody/notes
Notice the "Back to Kody" link changes based on whether you're on
/users/kody/notes
vs/users/kody/notes/whatever
.More info here: https://www.loom.com/share/0e7be5f39c4e4e58afacc96feb0fc730
Trying to add this to the users/kody/notes route and it's not working the way I want:
Expected Behavior
I expect to be able to use relative="path" and have that be relative to the path of the route I'm rendering within. As @ryanflorence said:
Actual Behavior
The relative path is currently relative to the url