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
I just found a solution for this without using the HashRouter. I created a little node script that's called before my deployment script that creates a 404.html file with the same content as the index.html. Github pages serves that file if you refresh on a page in your react-app.
const fs = require('fs')
fs.copyFile('build/index.html', 'build/404.html', (err) => {
if (err) throw err
console.log('index.html was copied to 404.html')
})