Home > Software engineering >  react-router not working in github deployment
react-router not working in github deployment

Time:06-02

Routing of the app

Json package

i can't figure out why it's not rendering anything and shows 404 page if i manually navigate to other page

CodePudding user response:

I had same problem once, The problem was that my webserver was serving "index.html" only for the root route ("/")

I configured the webserver in a way that all the routes (or only the ones that you are using) will serve index.hml. Please try to check this.

CodePudding user response:

React Router is not supported by GitHub Pages. See Notes on client-side routing from the create-react-app.dev website:

GitHub Pages doesn’t support routers that use the HTML5 pushState history API under the hood (for example, React Router using browserHistory).

However, there seems to be a workaround solution that you can implement to address this issue.

  • Related