How do I get GitHub Pages to re-render my React App?

雨燕双飞 提交于 2019-12-14 03:03:30

问题


I am currently having an issue having my React App re-render when I commit changes to my GitHub. I believe that the way GitHub Pages works with React is that it runs from a bundle.js file from a gh-pages branch of your GitHub. I have read from many StackOverflow questions that when I commit my changes, the website should update automatically, but this does not work at all.

On deeper thought this seems to make sense to me because my gh-pages branch is not being updated, it is the branch that I work on that is being committed to. When I first properly built and deployed my website, GitHub created the gh-pages branch on its own, so as far as I know there is no way to commit to it anyways. Does anyone know how I'm supposed to be updating my website properly? Currently I am only able to do this by rerunning the build/deploy command, and I'm pretty sure I'm not supposed to do that more than a few times an hour.

Thank you!

Edit:

Here is a link to my GitHub branch that hosts the files for the GitHub Pages website:

https://github.com/NumaKarolinski/PersonalWebsite/tree/websiteVersion1

Here is a link to my GitHub Pages branch:

https://github.com/NumaKarolinski/PersonalWebsite/tree/gh-pages

来源:https://stackoverflow.com/questions/51425769/how-do-i-get-github-pages-to-re-render-my-react-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!