freeCodeCamp/guide/english/react/installation/index.md

1.3 KiB

title
Installation

Installing React

Creating a new React project

You could just embed the React library in your webpage like so2:

<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.0.0/cjs/react.production.min.js"></script>

Smart programmers want to take the more practical and productive way: Create React App

npm install -g create-react-app
create-react-app my-app

cd my-app
npm start

This will set up your development environment so that you can use the latest JavaScript features, provide a nice developer experience, and optimize your app for production.

npm start will start up a development server which allows live reloading3.

After you finish your project and are ready to deploy your App to production, you can just use npm run build to create an optimized build of your app in the buildfolder.

Create React App repository

Sources

1. The React tutorial on installing

2. Link to the React minimal JavaScript library on cdnjs.org

3. npm start command