× logo Home HTML CSS Javascript React-App Angular.js logo
logo

Create React App

Create React apps with no build configuration.
Quick Overview

logo

Create React App works on macOS, Windows, and Linux.
Get Started Immediately
You don’t need to install or configure tools like Webpack or Babel.
They are preconfigured and hidden so that you can focus on the code.

Setting up a React Environment
Install create-react-app by running this command in your terminal:

npm install -g create-react-app

If you've already created the create-react-app you can skip this section.

Create React App

You’ll need to have Node 8.16.0 or Node 10.16.0 or later version on your local development machine (but it’s not required on the server). You can use nvm (macOS/Linux) or nvm-windows to easily switch Node versions between different projects. To create a new app, you may choose one of the following methods:

using [ npx ] to greate your first app

Install create-react-app by running this command in your terminal:

npx create-react-app my-app

(npx comes with npm 5.2+ and higher, see instructions for older npm versions) npm npm init react-app my-app npm init is available in npm 6+

using [ Yarn ] to greate your first app

Install create-react-app by running this command in your terminal:

Yarn create-react-app my-app

yarn create is available in Yarn 0.25+ It will create a directory called my-app inside the current folder. Inside that directory, it will generate the initial project structure and install the transitive dependencies:

my-app

Run the React Application
Now you are ready to run your first real React application! Run this command to move to the my-app directory:

cd my-app

Run this command to run the React application you just creat my-app:

my-app>npm start

A new browser window will pop up with your newly created React App! If not, open your browser and type localhost:3000 in the address bar.

logo