wouter
wouter copied to clipboard
Prevent "back button" navigation
I'm developing an app where I need to prevent "back button" in some cases, (e.g.: when I'm editing a form and I click back button I should receive a confirmation dialog before the navigation occurs).
I tried adding the well known beforeunload
event. But it only works when the navigation was not made via pushState
/setLocation
.
Is it possible to achieve the behavior I need with wouter?