-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Strip basename from location provided to getKey #10550
Conversation
🦋 Changeset detectedLatest commit: 797fcb1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Thanks for jumping on this so quickly, @brophdawg11. Any reason stripping basename isn't the |
It is the default - you should never be getting a path back with the |
packages/router/router.ts
Outdated
let loc = { | ||
...location, | ||
pathname: | ||
stripBasename(location.pathname, basename) || location.pathname, |
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.
Note to self: see about moving this to the RR layer since that's where the basename
stripping should happen to stay consistent
I'll see what I can do to get you a repro, but the fact that |
@jrnail23 Not quite. The location kept inside the |
Okay yeah, my bad @brophdawg11, I had it backwards. |
As a suggestion, distinct TypeScript types for internal location vs. user location may be helpful to ensure the correct kind of location is used in the correct places. Specifically (and I know this may be something of a controversial topic in TS), nominal/branded/opaque types, particularly in your internal-only stuff go a long way toward this goal. I use |
It turns out that when I mentioned that I had to stripBasename myself was in an |
|
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
Fixes issue raised in #9565 (reply in thread)
We were calling
getKey
inconsistently. From theusePageHide
hook it was theuseLocation
value (not includingbasename
) but from inside the router it was therouter.state.location
(includingbasename
). Now it's always the user-land version without thebasename