First create a react app using the terminal command
npm init react-app my-app
cd my-app
npm install gh-pages — save -dev
open package.json
add the following things of given below:
- “homepage”: “https://git_username.github.io/my-app/” before the name
- add scripts: “deploy”: “npm run build”, “deploy”: “gh-pages -d build”, and save this
- back to my-app directory
- git init
- git remote add origin https://github.com/user_name/my-app.git
- git push -u origin master
- npm run deploy
And the reactjs-app deployed to Github pages.
Top comments (0)