Then we will start to use DvaJS later.
It is an excellent lightweight application framework for React.
It has been widely used by many companies.
He is a solution of redux and redux-saga that can simplify operations
and also has built-in react-router routing and fetch network requests
First of all, it is not difficult to learn because the Api itself is relatively small, and it is also very convenient for redux.
As for the origin of his name, the character of Overwatch is called Dav.
Then let’s build an environment to have a look.
We directly open the terminal and enter
npm install dva-cli -g
Introduce dva globally
and our dependencies come in.
Then we right-click the command line tool to open it as an administrator
and enter it on the command line
dva -v
We can view our current version of dva.
We create a directory locally
and open the terminal as an administrator to enter
dva new 项目名称
If the project name is in English, I don’t need to emphasize it.
I use it here
dva new dva-quickstart
Then the console appears as shown in the figure below, just enter y and press Enter, and wait
for the command to be executed.
Here we can see that he has created a project for us.
The whole is a relatively standard project environment
. Then we still use the package first. The commands in json let him run first
npm run start
After we run it, we will find that there is an error message on it.
This is indeed a version, and the error report can be ignored.