I’m trying to implement basic routing for my application but got stuck with the difference between the BrowserRouter and Router. In my case Router is working properly, BrowserRouter is not routing properly.
I’m using a history object.
When the user clicks a button, it needs to be taken to the login page
history.push('/login')
const Routing = () =>
<Router history={history}>
<Switch>
<Route exact path="/" component={Home} />
<Route path="/login" component={Login} />
</Switch>
</Router>
Above one work, but if I use BrowserRouter instead of Router it is not working properly.