Describe the problem
I am using query params on a search page to store things like ?tags=foo,bar and when the user inputs an "empty" search (e.g. no tags filter), I want to clear away all the query params on the page. The problem is, pushState treats pushState('', {}) as a special call that does not update the route. The best I can do is pushState('?', {}) which leaves an ugly question mark in my url like so: /browse?.
Describe the proposed solution
What I would like is a way to fully clear away query params and the lingering ? character. I'm thinking this can either be the default behavior of pushState('?', {}) or it could be a special flag added like pushState('', {clearQueryParams: true})
Alternatives considered
No response
Importance
nice to have
Additional Information
No response
Describe the problem
I am using query params on a search page to store things like
?tags=foo,barand when the user inputs an "empty" search (e.g. notagsfilter), I want to clear away all the query params on the page. The problem is,pushStatetreatspushState('', {})as a special call that does not update the route. The best I can do ispushState('?', {})which leaves an ugly question mark in my url like so:/browse?.Describe the proposed solution
What I would like is a way to fully clear away query params and the lingering
?character. I'm thinking this can either be the default behavior ofpushState('?', {})or it could be a special flag added likepushState('', {clearQueryParams: true})Alternatives considered
No response
Importance
nice to have
Additional Information
No response