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

Enable chosing different Routers. #15

Open
SerdarSanri opened this issue Oct 26, 2022 · 8 comments
Open

Enable chosing different Routers. #15

SerdarSanri opened this issue Oct 26, 2022 · 8 comments

Comments

@SerdarSanri
Copy link

Currently main component is plain Router component. With recent changes in React-router v6.4+ some hooks can only run if you are using data routers like createBrowserRouter or BrowserRouter. Using embed Router component makes this library incompatible with new updates.

@plxmargaux
Copy link

What's the update on that one? Thanks a lot!

@asherccohen
Copy link

bump on this one

@lagunovsky
Copy link
Owner

I don't think it's possible. Because of new data APIs like loaders, actions, fetchers.

PR is welcome.

@tjad-oivan
Copy link

What are the full list of requirements for achieving this ?

@dannutiee
Copy link

Hi, is there any update on this one? 🙏

I am trying to use new router v6 hooks (e.g useBlocker) but they can be only used within Router that supports new data API (e.g RouterProvider) 😭

I tried to get around it by nesting <RouterProvider /> inside <ReduxRouter / > 👀 as someone tried here #20 but I ended with the same error 💁‍♀️ "You cannot render a <Router> inside another <Router>" (#20).

Looks that we cannot:

  • use two Routers in one app
  • use Router that support new data API because <ReduxRouter / > is based on plain Router component currently

@drosenzweig
Copy link

I'm in the exact same position as @dannutiee. Migrating a fairly large application from router v5 to v6, and got everything working up until trying to use the new data API.

@efraimrodrigues
Copy link

Same as @dannutiee .

@SerdarSanri
Copy link
Author

added a PR two years ago but still didn't get merged. with react-router v2 it us unfortunately not possible to use redux-react-router so we decided to not use it anymore and dropped the dependency.

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

No branches or pull requests

8 participants