Reprint Please indicate the source: Wang 亟亟 's way of Daniel
The last mention of react's content is almost 1 years, and then the year flat chest and feel that progress is not much, and then recently because of business needs and then are doing some front-end work.
And then all the way from NPM init all the way to configure Package.json to write scripts those, now the scaffolding line to wear, or sigh lazy people's world 6666
The old rules before the beginning of the case: Https://github.com/ddwhan0123/Useful-Open-Source-Android (a front-end article affixed to Android things fit. haha haha)
Not much talk about the introduction of the use of a more comfortable scaffolding is a Facebook Create-react-app
One is Ali's ant design of react installation Create-react-app
First install the Scaffold
NPM install-g Create-react-app
And then run
Create-react-app your project name.
And then the crackling is OK.
CD in
NPM Run Start
He's going to create a very pure react project.
That's what we're referring to.
"Dependencies": {"
react": "^16.2.0",
"React-dom": "^16.2.0",
"react-scripts": "1.1.1"
}
There is no other dependency, so if you want to add some libraries (UI components or something) yourself, install Antd
First install the Scaffold
NPM Install Antd-init-g
Then CD to the directory you want to build the project to
Antd-init
Then run the project
NPM start
ANTD Scaffolding relies on one of his own packages Antd
"Dependencies": {"
antd": "^3.0.0",
"moment": "^2.19.3",
"react": "^16.2.0",
"React-dom": "^16.2.0"
}
Upgrade Version
Scaffolding based on DVA
The first is to install scaffolding
NPM Install Dva-cli-g
Then create the project
DVA new dvatest
Running the project
NPM start
Effect as shown
Created is a project directory, there is "road rage", there are packaged script "high degree of Completion" project
Simplifies your "project cost", simple and easy to use.
But to be honest, Roadhog's encapsulation explains something relatively plain, climbing the pit ... Climb the pit ....