`push()` and `replace()` will keep current `search` and `hash` string
See original GitHub issueWhen
Current location is http://localhost?a=a#b
Do
history.push('/');
// OR
history.replace('/');
Expect
Location change to http://localhost
Actual
Location still is http://localhost?a=a#b
Issue Analytics
- State:
- Created 3 years ago
- Reactions:30
- Comments:6
Top Results From Across the Web
Share a link to this question - Stack Overflow
According to the docs: · length - (number) The number of entries in the history stack · action - (string) The current action...
Read more >History - React Router: Declarative Routing for React.js
The term “history” and " history object" in this documentation refers to the history ... action - (string) The current action ( PUSH...
Read more >Using React with the History API - Pluralsight
action - (string) The current action ( PUSH , REPLACE , or POP ) ... goForward() - (function) Equivalent to go(1).
Read more >History.pushState() - Web APIs | MDN
pushState() method adds an entry to the browser's session history ... only creates a new history entry if the current hash isn't #foo...
Read more >react-router: useHistory, useLocation and useParams
.replace(pathname: string, state: any)/(location: object): this is basically similar to push, but it will remove the existing history and update ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here’s my workaround:
Got the same issue