Create a react project using Create-react-app or ANTD

Source: Internet
Author: User
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 ....

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.