using router navigate change url but component does not load code example
Example 1: push a new route only triggers URL change but not location change
<ConnectedRouter history={history}>
<BrowserRouter>
<Switch>
<PrivateRouter exact path="/" component={App} />
<Route exact path="/login" component={Login} />
<Route component={NotFound} />
</Switch>
<BrowserRouter>
</ConnectedRouter>
Example 2: push a new route only triggers URL change but not location change
<Switch>
<>
<Route path="/">
<Welcome />
</Route>
<Redirect to="/" />
</>
</Switch>