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

Normalize search + hash strings in resolvePath #7953

Merged
merged 4 commits into from
Aug 18, 2021
Merged

Conversation

chaance
Copy link
Collaborator

@chaance chaance commented Aug 17, 2021

Fixes #7496

Copy link
Member

@mjackson mjackson left a 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(),
Copy link
Member

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.

Copy link
Collaborator Author

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()
Copy link
Member

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.

Copy link
Collaborator Author

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!

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

Successfully merging this pull request may close these issues.

2 participants