In the end, the answer was useBlocker
but that required re-factoring the route handler to createBrowserRouter
and directing the page content through an <Outlet />
in the RootLayout instead of having each page produce it's own child <RootLayout>
A bunch of work, but it stops exit before context is lost.