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

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

Open tiavina-mika opened this issue 2 years ago • 1 comments

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;

tiavina-mika avatar Aug 29 '23 14:08 tiavina-mika

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

DmitriyWebDev avatar Sep 01 '23 19:09 DmitriyWebDev