Posting this reply because I ran into the same problem and using the response marked as a solution did not work for me.
To publish my page, I followed the steps in here: https://github.com/gitname/react-gh-pages
I got a 404 error when I navigated to <username>.github.io/<repo-name>
What worked for me was
-ensuring my repo was public
-changing the name of my repo to a new name (to repo-name2 for example) and then
-updating the package.json file with “homepage”: “http://<username>.github.io/<repo-name2>”
-then running npm run deploy command again
this fixed the problem for me.