lagunovsky / redux-react-router

A Redux binding for React Router v6
MIT License
72 stars 9 forks source link

You cannot render a <Router> inside another <Router> #20

Open tiavina-mika opened 1 year ago

tiavina-mika commented 1 year ago

After I upgraded to "react-router-dom": "^6.15.0", I've got this error: Uncaught Error: You cannot render a <Router> inside another <Router>. You should never have more than one in your app.

Here is my Routes component

import { createBrowserRouter, RouterProvider } from 'react-router-dom';

const router = [
  {
    path: '/',
    element: <DashboardRouteLayout />,
    children: [
      {
        path: '/',
        element: <RouteWrapper component={Home} />,
      },
    ],
  },
]

const Routes = () => {
  return (
    <ReduxRouter history={history}>
      <RouterProvider router={createBrowserRouter(router)} />
    </ReduxRouter>
  )
};

export default Routes;
DmitriyWebDev commented 1 year ago

Can you create a simple github repository to reproduce the issue?