should not use switch outside a router code example
Example: you should not use switch outside a router react
<BrowserRouter>
<Switch>
//your routes here
</Switch>
</BrowserRouter>
<BrowserRouter>
<Switch>
//your routes here
</Switch>
</BrowserRouter>