React Router browserHistory not working as expected

When using browserHistory, you must configure your server appropriately to serve at all routed paths. See this for details.


I had same problem. So as above @taion's answer told that we need to configure express server to make hot reloading with URLs in routes.

But if you don't want to put express server additionally just to make hot reloading work, use this to run your project.

webpack-dev-server -d --history-api-fallback --hot --inline --progress --colors

Earlier, I was using just this which needs express server to be configured

webpack-dev-server --hot --inline

NOTE: But I still think, you need to configure for nginx when you'll deploy. The above commands I told are just for development purposes. So don't forget to look at this as @taion told.