Skip to content

Conversation

@karlshea
Copy link

@karlshea karlshea commented Apr 20, 2022

This allows adding blockers that don't create a beforeUnload event, so blocks can prevent or otherwise handle location changes but won't block reloading the page.

Normal blockers are looked at first (to support prompts), and then if they all allow the transaction the no-unload blockers are checked afterwards.

See #921 for reasoning (forcing a full page load for non-SPA routes). What are the maintainer's thoughts on this approach?

@ofirgeller
Copy link

Could also add a flag to block. would like to see some solution merged, I had to drop the blocking feature on an app so i can upgrade to react-router v6 which sucks :(

@tobi-fis
Copy link

tobi-fis commented Jun 6, 2025

I don't understand how this is not merged yet. The unavoidable beforeunload handler forces you to implement hacky workarounds if you simply want to intercept navigations by using push, without the misleading browser popup showing up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants