A brief introduction to react (1) Build a react environment and build a react project

1. The node environment is deployed

Enter in the terminal node -v
to display the node version number; for example: v10.14.1
enter in the terminal npm-v
to display the npm version number; for example:6.6.0

2. Build a simple react single page application

Create a new folder on the desktop; such as: react-learn;;
Open the folder in the terminal;
enter the file directory in the terminal: npx create-react-app my-app;
After loading, enter: cd my-app;
Enter my-appthe directory;
then run npm start;
Note: npx is npm 5.2+ The attached package running tool. Requires environment version Node >= 8.10 and npm >= 5.6.
You can see the following effect in the terminal:
insert image description here
Then open it with a browserhttp://localhost:3000

3. The final rendering

insert image description here

Guess you like

Origin blog.csdn.net/samxiaoguai/article/details/105966559