Deploy a React App with ZEIT Now and Create React App

Create your Create React App project and deploy it with ZEIT Now.

React is a popular open-source JavaScript framework, maintained by Facebook, for easily creating interactive single-page apps (SPAs).

In this guide, we will cover how to set up a React app with Create React App (CRA) and how to deploy it with ZEIT Now.

Create and deploy a new React project with ZEIT Now without the setup using the button below.

Step 1: Set Up Your React Project

Get started by setting up a React app using the Create React App (CRA) CLI tool. With this, you can generate a project to get up and running with React.

Using npm, you can setup a React app with CRA with the following command in your terminal:

npm init react-app my-react-app && cd my-react-app

Bootstrapping a React app with Create React App through npm.

If you would prefer to use another method, see the Quick Start documentation for CRA.

Step 2: Deploying Your React Project with ZEIT Now

With your React application set up, it is ready to deploy with Now.

If you have not yet installed Now, you can do so by installing Now CLI.

With Now, you can deploy your app to different environments, depending on what stage your app is at; either staging or production.

To deploy your React project, use the following Now CLI command from your terminal:

now

Deploying the app with the now command.

If you want to deploy your React project when you push to a Git repository, you can use either Now for GitHub or Now for GitLab to have your project automatically deployed on every push, and the production domain updated on push to master.



Written By
Written by timothytimothy
Written by grovesjosephgrovesjoseph
on February 6th 2019