question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Are there any plans to support history location state clearing?

See original GitHub issue

Are 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
timdorrcommented, Jan 6, 2021

Oh cool, I can transfer these now. Sorry, just learning the new features (which I think is over a year old, so “new”)

1reaction
timdorrcommented, Jan 6, 2021

This would be a question for the history library: https://github.com/ReactTraining/history

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found