-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[DO NOT MERGE] Add test for transition to with basename #4008
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
[DO NOT MERGE] Add test for transition to with basename #4008
Conversation
<Router basename={BASENAME}> | ||
<div> | ||
<Link id="target" to={TARGET}>{TARGET}</Link> | ||
<Match pattern={TARGET} render={() => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll probably have to add a leading slash to the pattern here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I merged remix-run/history@df60c49 into history today which automatically takes care of this in the history lib.
), div) | ||
|
||
const href = div.querySelector('a').getAttribute('href') | ||
expect(href).toEqual('/foo/bar') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but the href
is /foobar
.
Maybe we need to have a little discussion about relative targets. Is that even something you want to support? |
See also #3901. |
don't worry about the relative links right now, they are far more tricky than they seem when you add a nesting paradigm in (@mjackson has some PoC work around it) but that first test seems like we have a problem. |
Is there anything I can do to help with this? |
#4122 will probably resolve this. |
@jochenberger It almost does, but not quite. the |
I commented on our relative strategy in #4122 (comment). Basically, there are two different scenarios for making something "relative": |
I added two integration tests that use a
basename
. I think that they should pass but I'm not sure. See #3839 (comment) for reference. I can try to come up with a fix if you agree that it needs fixing. ;-)