Replies: 2 comments
-
React Router uses the browser History API Apparently Firefox stores history state on the users disk so it is recoverable after browser restarts, but I'm not sure I'd rely on that as it's most likely an implementation choice as the spec doesn't define anything about persistence. I would assume that history state will at least live for the life of the browser session.
https://developer.mozilla.org/en-US/docs/Web/API/History/pushState |
Beta Was this translation helpful? Give feedback.
-
I'm pretty sure it's using something like this: https://developer.mozilla.org/en-US/docs/Web/API/History/state |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently passing a state object into history.push and utilizing it with the useLocation hook in the new page. I'm curious as to where the state is stored and is it reliable in terms of will it ever be lost from refresh, closing tab, closing browser, or any event? I'm doing this so that I don't have to make unncessary requests to my server for the same data that I already have from the page I'm navigating from.
Beta Was this translation helpful? Give feedback.
All reactions