Using the create – react – app

1. Install create-react-app globally

npm install -g create-react-app

2. Create the React project

Create-react-app my-app indicates the name of its own project

3. After the project is created, go to the root directory and start the project

Webpack versions are different. If an error occurs, uninstall webpack and install the corresponding version

4. Project Catalog

5. Hello react instance

Add to index.js file

ReactDOM.render(
  <h1>hello react</h1>.document.getElementById('root'));Copy the code

Go to localhost:3000