Home > Web Front-end > JS Tutorial > body text

What is create-react-app? create-react-app builds applications for React development environment

不言
Release: 2018-09-07 16:32:24
Original
2690 people have browsed it

What is create-react-app? What can create-react-app do? This article will share with you how to build a React development environment using create-react-app.

1. What is create-react-app?
It is very difficult for beginners to build a react project and build its development environment! Therefore, Facebook specially developed the create-react-app command for building the react project development environment!

create-react-app is created based on webpack ES6.

2. How to use.
Execute the following commands on the command line in sequence to complete the project construction.

cnpm install -g create-react-appcreate-react-app my-app 
//这里的my-app是随便起的一个项目名称而已。
cd my-app/
npm start
Copy after login

The final project directory is as follows:
What is create-react-app? create-react-app builds applications for React development environment
The rendering is like this:
What is create-react-app? create-react-app builds applications for React development environment
3. Description of the project directory:
public Folder: The index.html inside is the project template of the index entry page that is finally packaged for the entire react project. But it has nothing to do with our code writing, and is related to the final page display.

src folder: is where we write code.

src/index.js: It is the entry js file of the entire project.
src/app.js: It is a component introduced by index and also represented by a js file.
src/index.css: style file in index.js.
src/app.css: It is the style file of app.js.
logo.svg: It is an svg image file. Used for interface display.

4. However, I personally will not be satisfied with such a structure, and it is not suitable for development.
The following is an initial transformation I made:
What is create-react-app? create-react-app builds applications for React development environment

Change the directory, change the project path, and continue our project development work in this directory.

Related recommendations:

WeChat Mini Program Tutorial Mini Program Configuration

Comparative Differences between WeChat Mini Program and Alipay Mini Program introduce

The above is the detailed content of What is create-react-app? create-react-app builds applications for React development environment. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!