Reputation: 1087
In my application I am using
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-redux": "^5.0.3",
"react-router-dom": "^4.0.0",
"react-router-redux": "^4.0.8",
"redux": "^3.6.0"
and in my codes I have a Link (import {Link} from "react-router-dom";)
<Link to="login">Login</Link>
When I click on it, it is changing the url, also in the redux dev tool I can see that routing pathname is being changed, but the component for login path is not becoming visible.
You can check the code on my Github repository
Upvotes: 3
Views: 3760
Reputation: 1087
I found the solution here
The problem is that in the beta react-router version you need to wrap exported component into withRouter like in the code bellow
export default withRouter(connect(mapStateToProps, mapDispatchToProps)(App));
Here is my commit in my github project
Upvotes: 4
Reputation: 464
Inside Your <Router>
add entry:
<Route path="/login" component={Login}>
Without it React don't know which component should be used.
And login in Link should be preceeding by slash:
<Link to="/login">Login</Link>
Upvotes: 0