In order to give beginners a quick introduction to the front-end technology, I wrote this series of articles. This part mainly covers building the React environment and demo.
-
1. Build Demo
-
2. Program debugging
-
3. Package and deploy
Create a React Demo quickly
Use create-react-app to quickly build the React development environment
Create-react-app is a Facebook app that allows you to quickly build the React environment without configuration.
Create-react-app automatically creates projects based on Webpack + ES6.
1. Run the following commands on the terminal one by one to create projects:
$ npm install -g create-react-app
$ create-react-app my-app
$ cd my-app/
$ npm start
Copy the code
Open it in Google Chromehttp://localhost:3000/
, the results are shown in the figure below:
Iii. Directory structure of the project is as follows:
Manifest.json specifies the start page, index.html, where everything starts, so this is the source of code execution.
Reference Documents:
React Rookie document
React 英 文 版
Use React to develop new projects
Add React to an existing project