How to Host Your React App on GitHub Pages

$ npx create-react-app github_pages_repo
$ cd github_pages_repo
$ git init
$ git add .
$ git commit -m "initialCommit"
$ git remote add origin https://github.com/username/github_pages_repo.git
$ git push origin master
npm install gh-pages --save-dev
“homepage”: “http://devchea.github.io/github_pages_repo"
"scripts": {  
"start": "react-scripts start",
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
npm run deploy

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store