The so-called beginning of everything is difficult, the purpose of this article is to explore react students, the establishment of the first basic react application.
The Create React app is one of the official Facebook scaffolding tools to quickly build a new React single page app that can help you configure your development environment so you can use the latest JavaScript features, provide a great development experience, and optimize your app for your production environment. (If you've used VUE-CLI to build a Vue app, here's an analogy)
Words don't say much, just start.
Installation
Global Installation Create-react-app
NPM install-g Create-react-app
Tips: If the installation fails, update node and NPM to the latest version retry
Create a new app
Create-react-app my-App
A My-app folder is created under the current directory with the following directory structure:
my-public│ └──favicon.ico│ └──index.html│ └──manifest.json└──src └── App.css └──app.js └──app.test.js └──index.css └──index.js └──logo.svg └── Registerserviceworker.js
Run
CD my-appnpm start//or yarn start
Enter the My-app directory to run NPM start or yarn start
The default browser access http://localhost:3000 is turned on (if the browser does not open automatically, you can access the http://localhost:3000 manually)
Next you can create your own app by modifying the Index.js file!
React Long Learning Road of Create a React app with the Create React app command