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

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

Open
tiavina-mika opened this issue Aug 29, 2023 · 1 comment
Open

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

tiavina-mika opened this issue Aug 29, 2023 · 1 comment

Comments

@tiavina-mika
Copy link

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
Copy link

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

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

2 participants