I've used create-react-app and deployed it to my github pages site following instructions from this site https://hackernoon.com/how-to-deploy-a-react-app-to-github-pages
however whenever I change contents of my App.tsx file and then push changes to master, the github pages site doesn't reload with the changes. Am I supposed to push changes to the gh-pages branch instead?
CodePudding user response:
Did you install git
and gh-pages
? Then, your package.json
looks like something like this.
"scripts": {
deploy: "gh-pages -d build",
predeploy: "npm run build"
},
After that, you create repository
in github. Get repository url. For first deploy.
git init
git remote remove origin
git remote add origin YOUR_REPOSITORY_URL
npm run deploy
For next update. only npm run deploy
.