I'm using react-router-component (not react-router) to handle routing in my single page application. Refreshing the page or typing route manually in address bar results in page not found. How to handle the refresh and navigation by address in react-router-component?
Asked
Active
Viewed 215 times
2
-
What are you using as a backend? Here's [an example for node.js](http://stackoverflow.com/a/39980395/6941627). – Fabian Schultz Oct 28 '16 at 10:54
1 Answers
1
By default the server will look for an html file at the route it receives. So you should configure it for html5 navigation to return you index.html for any route it receives.
For example with webpack-dev-server, you can add this to your webpack dev server config:
historyApiFallback: true

Christopher Chiche
- 15,075
- 9
- 59
- 98