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