Are there any plans to support history location state clearing?
See original GitHub issueAre there any plans to support history location state clearing?
Sometimes we use history.location.state
to pass “temporary state”. When finished using, it should be cleaned up immediately. As far as I know, there is NO API to clear the location state, and the only workaround is:
history.replace(currentPath, undefined);
I don’t want to argue about where the “temporary state” should be kept, that’s a different issue. Adding a history
API to clear history.location.state
sounds reasonable.
Thanks 🙂
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How do I clear location.state in react-router on page reload?
In react Router V6 you can use useNavigate() to clear state for current path: ... do any visible effect other than clearing the...
Read more >POP history will clear function in location.state? #3221 - GitHub
First of, I what to send function around in state of location /path1 const state ... then i will send the state around...
Read more >Manage your Location History - Android Help - Google Support
Location History is a Google Account–level setting that saves where you go with every mobile device where: You're signed in to your Google...
Read more >Delete significant locations on iPhone - Apple Support
Tap Clear History. This action clears all your significant locations on any devices that are signed in with the same Apple ID.
Read more >How to Clear Your Browser Cache - Fort Valley State University
In the Cookies and Site Data section, click Clear Data… ... Any tabs you have open at the time you clear your browsing...
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
Oh cool, I can transfer these now. Sorry, just learning the new features (which I think is over a year old, so “new”)
This would be a question for the history library: https://github.com/ReactTraining/history