Ok, so I\'ve made a SPA using React and React-Router and have pushed it to github pages, but none of the routes I have written work when I refresh or click back in my browse
Aside from using hashHistory
as suggested in the accepted answer, there is another workaround. Look here.
Basically, you create a spoof 404.html
file which has a script that converts the requested path into the query string & redirects the browser to the index page with the query string attached to the URL. After the index file is loaded, the original path is restored from the query string & ReactRouter
picks up the changes.
A neat solution, but not production-ready, either.