1.6 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
npx create-react-app my-app
cd my-app
npm start
Another option is using the package npx
which doesn't require you to install the package create-react-app
before using it. So you can use it without installing it which is helpful for the future not to have too many packages installed on your machine
npm install -g npx
npx create-react-app my-app
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 build
folder.
Useful links
Sources
1. The React tutorial on installing
2. Link to the React minimal JavaScript library on cdnjs.org