Solid Router: save page state inside useBeforeLeave
Hello everyone
I have a case when I want to save some of the page state inside history to be able to access it if user goes back at some point. I see useLocation router primitive, but the .state there is something passed frim useNavigate. In my case I want to save this state inside useBeforeLeave.
I know I can just use history.replaceState browser API, but the problem is I need to use either standard Router, or MemoryRouter, depending on platform the app is running at, so I would love to stick to solid-only api
0 Replies