Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: useBlocker works incorrectly when searchParams are changing #10803

Closed
IvanGrekov opened this issue Aug 21, 2023 · 0 comments
Closed

[Bug]: useBlocker works incorrectly when searchParams are changing #10803

IvanGrekov opened this issue Aug 21, 2023 · 0 comments
Labels

Comments

@IvanGrekov
Copy link

IvanGrekov commented Aug 21, 2023

What version of React Router are you using?

6.13.0

Steps to Reproduce

  1. Microfrontends
  2. Host (Shell app) is using BrowserRouter
  3. MFs are using MemoryRouter

When users are going to change tab inside the app (tabs are connected to searchParam), useBlocker shows prompt only one time, if users decided to stay on the current page and after that, at once, they are clicking on the same tab they wanted to navigate earlier, useBlocker even doesn't execute BlockerFunction.

Tried to connect tabs to pathParam instead of searchParam - it hasn't help

Tabs are rendering in the one MF

If users are tying to navigate to another page, from another MF - it always works correctly

If I start the MF in isolation, that means it uses BrowserRouter, everything works as expected

Expected Behavior

Users should see a prompt by useBlocker each time when they want to change searchParam, event it's the same searchParam's key and value

Actual Behavior

If it's the same searchParam's key and value, users see a prompt by useBlocker only one time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant