DEV Community

Cover image for How to create a React app
Charity Parks
Charity Parks

Posted on

How to create a React app

Creating apps in React are my favorite!!! React is a really fun and simplistic JavaScript library. I used to always have to look up how to set up a new React single page app, so I thought this post could be helpful to someone new to React.

First check to see if you need to install npm. npm is the world's largest Software Registry. Its what developers use to share software. You can check to see if you have it and what version it is by typing this into the command line: npm -v . If you need to install it, then do so.

The easiest way, in my opinion, to start building a React app is by installing create-react-app. It comes with the newest JavaScript features, Babel and Webpack.

  • In the command line type: npm install -g create-react-app
  • After that installs: cd into the folder you want your app to reside.

Now to create a new app:

  • create-react-app PROJECT_NAME
  • cd into PROJECT_NAME
  • In the terminal type: npm start
  • In the browser go to: http://localhost:3000/

In my next post I will share my next steps to take to create an awesome React App!

Top comments (1)

Collapse
 
ziv profile image
zivka

You can use ‘npx create-react-app app-name’ si you won’t need to install it globally