You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'll suggest to use the newest 8.0.0 beta version. There is a leave hook that accepts a callback.
router.on("/about",(match)=>{render("About");},{leave: (done)=>{if(confirm("You are about to leave the About page. Are you sure?")){done();}else{done(false);}},})
When the user lands on /about and tries to go out will see that confirmation window. The router does nothing until you call the done function. (the full example here)
We're having to add confirmation before leaving, I see that
Navigo
has thebefore
, but it's not receiving event.Is there an alternative solution for this?
The text was updated successfully, but these errors were encountered: