React router redux always show the first route. No matter which url i entered, it will render the first route.
Index.js file
<ConnectedRouter history={history}>
<App />
</ConnectedRouter>
App.js file
export default function App() {
return (
<Switch>
<Route to="/" component={Dashboard} key={1} />;
<Route to="/icons" component={Icons} key={2} />;
</Switch>
);
}
just add exact={true} to Route, default exact is set to false, just take a look here.
<Route exact path="/" component={Dashboard} key={1} />;