redux-react-router icon indicating copy to clipboard operation
redux-react-router copied to clipboard

Enable chosing different Routers.

Open SerdarSanri opened this issue 2 years ago • 8 comments

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.

SerdarSanri avatar Oct 26 '22 17:10 SerdarSanri

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

plxmargaux avatar Dec 28 '22 09:12 plxmargaux

bump on this one

asherccohen avatar Feb 06 '23 15:02 asherccohen

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

PR is welcome.

lagunovsky avatar Feb 20 '23 09:02 lagunovsky

What are the full list of requirements for achieving this ?

tjad-oivan avatar May 17 '23 06:05 tjad-oivan

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

dannutiee avatar Jan 03 '24 17:01 dannutiee

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.

drosenzweig avatar Jan 05 '24 20:01 drosenzweig

Same as @dannutiee .

efraimrodrigues avatar Jan 12 '24 15:01 efraimrodrigues

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.

SerdarSanri avatar Feb 11 '24 04:02 SerdarSanri