Closed taylorjames closed 9 years ago
I think this would be better to solve without onbeforeunload. We currently support this since it is browser behavior that is circumvented when doing client-side navigation. You could consider this a polyfill for functionality that the browser provides on HTTP navigation. We follow the same synchronous specification that the browser follows in this implementation and I think changing this behavior to be async could digress into a lot of edge cases.
It seems a bit restricting that the NavLink window.onbeforeunload event can only be passed a string which will trigger a window.confirm('string'). I would like to handle the confirm myself with a modal instead of a window.confirm.