The first step: Make sure you install a newer version of the Node.js .
Step 2: Create React App
npx create-react-app my-app
cd my-app
npm start
Yarn used here instead of npm.
The interface looks like at this time to run is not what we want.
The third step: delete all the files in the new project in src / folder.
Step four: src/
folder, create a named index.css
file, and copy the CSS code .
Step Five: In the src/
Create a folder named index.js
file, and copy these JS code .
Step Six: The following three lines of code to copy the src/
folder index.js
at the top of file:
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
Step Seven: Start
yarn start
Reproduced in: https: //www.jianshu.com/p/5e3da147afce