ZacharyRSmith/react-router-navigation-prompt

Multiple BrowserRouter instances breaks NavigationPrompt

mellis481 opened this issue · 1 comments

If there are multiple BrowserRouter instances, NavigationPrompt doesn't work as expected.

https://oq16x.csb.app/sub/route1

  1. Dirty form
  2. Clicking the "Go to test" link works
  3. Clicking the "Go to test (top-level)" link does not work

Thanks for the reproducing example!

I would not expect NavigationPrompt to work with multiple BrowserRouters. In your example, I change NavigationPrompt to react-router's Prompt, and it didn't work either. I just updated the README to call this out. Please reopen if it makes sense to.