React Tutorial (vi)--using Create-react-app to quickly build a react development environment

Source: Internet
Author: User

1, Create-react-app is what.
To be a react project, it is difficult for beginners to build their development environment. So, Facebook specifically made the Create-react-app command for building React project development environment.

The Create-react-app is created based on WEBPACK+ES6.

2, how to use.
Execute the following command at the command line in turn to complete the project build.

CNPM install-g create-react-app
create-react-app my-app//The My-app here is a random project name.
CD my-app/
npm start

The resulting project directory is as follows:

The effect diagram is this:

3, the description of the project directory:
Public folder: Inside the index.html, is the project template for the final packaged index entry page of the entire react project. But it has nothing to do with our code writing, and the final page presentation is relevant.

src folder: Is where we write code.

Src/index.js: Is the entry JS file for the entire project.
Src/app.js: is a component that is introduced by index and is also represented by a JS file.
The style file in the src/index.css:index.js.
SRC/APP.CSS: Is the app.js style file.
Logo.svg: is an SVG image file. Used for interface display.

4, but the individual will not be satisfied with such a structure, is not suitable for development.
Here's a makeover for me to do an initialization:

Change the directory, change the project path, in such a directory, continue our project development work.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.