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.