Reputation: 1098
Only root route works. /about, /home shows "Cannot GET /home" in browser. If i replace each route path with "/" then the corresponding component is rendering. But there seems to be problem when i try to render certain route eg /home.
Upvotes: 0
Views: 3132
Reputation: 11093
You have to configure your server to work with Router.HistoryLocation
-- that is, it needs to always serve your index.html page regardless of the route.
app.get('*', function (req, res) {
res.render('index');
});
Check out the docs here: React Router Docs - HistoryLocation
Upvotes: 1