How to Build and Deploy React App on Netlify

How to Build and Deploy React App on Netlify

Netlify

·

1 min read

Prerequisites

Steps

  1. Create an empty GitHub repository which can be public or private.

  2. Create a simple React app

     npx create-react-app netlify-react-app
     cd netlify-react-app
    
  3. Set Github remote origin URL.

     git remote add origin https://github.com/gitname/netlify-react-app.git
    
  4. Push the code changes to master branch.

     git add .
     git commit -m "Configure React app for deployment to Netlify"
     git push origin master
    
  5. Go to Netlify and import the project which is the above GitHub repository.

  6. Click on deploy site and wait for a few seconds for the deployment to be completed.

  7. Now you can test the app deployed by hitting the below URL.

    Netlify App - https://master--spectacular-crumble-5461b7.netlify.app/
    Repository - https://github.com/reevchris100/netlify-react-app/tree/master