Can I have a prompt before navigating to another page

I have a editor page, I want to give user a prompt when user try to navigate away if the work is not saved .
I found something like this for react, I am wondering if readwood router can do something like this:


That might be a react router v6 limitation unfortunately, you can see here:

Scratch that answer, I don’t know why I thought redwood used react router v6… It doesn’t, but I don’t see any possibility for prompt with the redwood router


The standard way of handling this is the beforeunload event. Does that not work for you? There is nothing built-in to the redwood router for this