-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Normalize search + hash strings in resolvePath
#7953
Conversation
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.
Thanks!
function Home() { | ||
path = useResolvedPath({ | ||
pathname: "/home", | ||
search: new URLSearchParams({ user: "mj" }).toString(), |
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.
You could also just do:
search: "?user=mj"
which I think is a little more direct. Unless ofc you're trying to test the behavior of URLSearchParams#toString, which it doesn't seem like.
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 was writing the test as I figured a user might write their code, as they did in the root issue, but that would translate to search: "user=mj"
I believe, yeah?
function handleClick() { | ||
navigate({ | ||
pathname: "../about", | ||
search: new URLSearchParams({ user: "mj" }).toString() |
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.
Same comment as below about just using "?user=mj"
as your search
value.
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.
Same response, I was trying to write these as a user might (a la #7496) but if you feel strongly about it I can change them!
Fixes #7496