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

Default search params from validateSearch do not populate the URL #1184

Open
efie45 opened this issue Feb 14, 2024 · 4 comments
Open

Default search params from validateSearch do not populate the URL #1184

efie45 opened this issue Feb 14, 2024 · 4 comments

Comments

@efie45
Copy link

efie45 commented Feb 14, 2024

Describe the bug

When using validateSearch, if you return a default value it becomes available via the useSearch hook in a component, but it does not appear in the URL.

Your Example Website or App

https://stackblitz.com/edit/github-cqxxd6?file=src%2Froutes%2Fabout.tsx

Steps to Reproduce the Bug or Issue

  1. Click on the 'about' link

Expected behavior

The default parameter from validateSearch is available via useSearch but does not show in the URL search params.

Screenshots or Videos

No response

Platform

  • OS: Windows
  • Browser: Chrome, Edge

Additional context

No response

@ruiaraujo012
Copy link

Same thing here, any update on this?
I'm having a strange behavior where my validateSearch run link 20 times or more when I navigate to the route (and run about 4 times in other routes)

@amjed-ali-k
Copy link

Your Example Website or App

stackblitz.com/edit/github-cqxxd6?file=src%2Froutes%2Fabout.tsx

This link is invalid

@a1eksandrk
Copy link

Raising the question. I also encountered this problem when using useNavigate, during validation the default parameters are returned, but they are not substituted in the URL.

@collinosh
Copy link

This is our biggest migration hurdle so far. Our users often share links to daily reports/metrics which aren't always opened the same day by the recipient- because the default state is omitted from the URL, there's no way to guarantee state consistency without forcing a redirect to update the search.

Would love to hear if anyone has a better solution, love the type safety of this library but I'm finding myself sinking far too many hours trying to reinvent the wheel.

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

5 participants