How to detect if I got to the Route with back button or navigate(-1)
Struggling with this one. I know I can probably use 'popstate' event but is there any solid-router approach?
3 Replies
Strange, but useBeforeLeave not triggering for back button or even navigate(-1)
after a few hours of digging I found that useBeforeLeave relies on history.state _depth property to trigger correctly for history traversal. Unfortunately I was not expecting someone else to mess with history and erased it with my data. If I keep this property everything work as expected.
this begs for a notice in the docs