React framework learning, record configuration and operation, and actual combat

premise

1. You need to install node.js in advance
2. You need to compile the software (I use VScode here), you can download it yourself
3. React Chinese official website https://react.docschina.org/tutorial/tutorial.html#setup-option -2-local-development-environment

My current node version (for reference only)insert image description here


initialization

build development environment

Open cmd and run it as an administrator (forgot to take a screenshot, the installation is successful)
npm install -g create-react-app

first initial project

  • Open cmd under the folder where the project is stored, create a project, and my-react-app is the name of the project. If you
    create-react-app my-react-app
    see the content in the following screenshot, it is successful.
    insert image description here
    insert image description here

  • Enter the project root directorycd my-react-app
    insert image description here

  • runnpm start
    insert image description here

  • At this time, use a browser to access - http://localhost:3000/ to view the following page, indicating that the initialization is successful
    insert image description here
    ↑ 2.17 update

Guess you like

Origin blog.csdn.net/qq_44035882/article/details/129080826