Use Create-react-app to build react applications

Source: Internet
Author: User

It is basically impossible to use react.js like Bootstrap direct reference. Using react requires a bunch of tools and libraries, Babel for compiling, redux and other third-party state management tools to organize your code. So here are the tools to build react applications based on the official recommended tool Create-react-app. Using this tool can realize "one-stop service", help us to do a variety of configurations and dependencies, so that "out of the box".

Tool Address: Https://github.com/facebookincubator/create-react-app

    Basic Environment Installation:

Make sure the node,:https://nodejs.org/en/is installed on the machine before use

( tearful Recommendation:Windows users recommend installing the LTS version of node, using the latest version of the installation tool may not be successful, which may be caused by NPM version problems)

After installing the environment, follow the steps of the official website to install Create-react-app:

   Install -G Create-react-app

This command installs a Create-react-app command on the machine that can be used to build a react project directly:

   Create-react-app React-demo

Tips:

The installation process may be slow, most likely due to the download of NPM from a foreign source. It's good to change NPM to a domestic Taobao image before executing the above command :

    NPM Config Set registry https://registry.npm.taobao.org

after the download is complete, you can start the project, enter the project directory and enter:

    CD react-demo    npm start

after the successful run, the command line appears as follows:

and will automatically open the browser http://localhost:3000 (my title has been modified in src/app.js):

so far You're ready to start customizing your react app!

Use Create-react-app to build react applications

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.