spa-github-pages
spa-github-pages copied to clipboard
React-router params
Hello! I keep id in router params. And when the page is reloaded, a request is made to the server for this id
But for some reason, nothing happens to me instead and it seems that the whole application crashes (white screen, 404 errors in the console)
I don't understand what's wrong. Didn't find a solution..
I have the same problem using React BrowserRouter with useParams(). Did anyone find a solution for this yet?
I just solved it, the problem was, that the app was looking for owner.github.io/assets/index.js instead of owner.github.io/repo/assets/index.js. I solved this by adding base: '/repo/' in my vite.config.js.