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

[v6] navigate({ search }) modifies path #7496

Closed
onionhammer opened this issue Jul 9, 2020 · 5 comments
Closed

[v6] navigate({ search }) modifies path #7496

onionhammer opened this issue Jul 9, 2020 · 5 comments

Comments

@onionhammer
Copy link

onionhammer commented Jul 9, 2020

Version: 6.0.0-beta.0

For URL: some/path

Code:

const navigate    = useNavigate();
...
navigate({ search: new URLSearchParams({ "foo": "1", "bar": "2" }).toString() });

Expected URL: some/path?foo=1&bar=2

Actual URL: some/pathfoo=1&bar=2

Workaround (hack):

const search = new URLSearchParams({ "foo": "1", "bar": "2" }).toString();
navigate({ search: search.length ? "?" + search : "" });
@StringEpsilon
Copy link
Contributor

Possibly related: remix-run/history#813

@onionhammer
Copy link
Author

@StringEpsilon yep, that looks like its related, assuming navigate() uses that function internally

@stale
Copy link

stale bot commented Sep 30, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
You can add the fresh label to prevent me from taking any action.

@stale stale bot added the stale label Sep 30, 2020
@onionhammer
Copy link
Author

Afaik this has not been fixed

@timdorr
Copy link
Member

timdorr commented Aug 19, 2021

Closed by #7953

@timdorr timdorr closed this as completed Aug 19, 2021
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

No branches or pull requests

3 participants