Is it possible to do something like this: https://reacttraining.com/react-router/web/example/preventing-transitions with Nextjs ?
Yes, it's possible, but you'd have to implement it yourself with a custom Link component.
But I believe it would not work with browser "back" button.
I have a form on my site and on a route change I'd like to display a prompt if the form has unsaved changes. There's no way I see I can accomplish this in Next.js at the moment. And like @Tomekmularczyk said, even if I wrote a custom Link (which would be hard because I use next-routes) it would still not handle browser history events.
Most helpful comment
I have a form on my site and on a route change I'd like to display a prompt if the form has unsaved changes. There's no way I see I can accomplish this in Next.js at the moment. And like @Tomekmularczyk said, even if I wrote a custom Link (which would be hard because I use
next-routes) it would still not handle browser history events.