DEV Community

Discussion on: How to deploy React App to GitHub Pages

Collapse
piruthuvi22 profile image
Piruthuvi

I got this same problem in the beginning. If you follow this tutorial correctly,then try this one.

Your home page route should be like this





<Route exact path="/your github repo name">



instead for

and in your rendered component change the




<Link to="/your github repo name">



instead for




<Link to="/">



And another important point you should consider. your github repo name must be valid name for example dots or space should not be in your repo name because that things conflict with URL.
Collapse
ultrax007 profile image
Rajat Sawarkar

this should be mentioned in the create-react-app docs, was so frustrated because of this simple code change, thanks alot mate @Piruthuvi

Collapse
learndeepak profile image
Learn-Deepak

Thanks a lot @Piruthuvi.