先创建一个 react 工程化项目
使用开源的脚手架 create-react-app
通过 npx create-react-app react-bisic (名字) 命令
我们打开目录,react 脚手架构成的主要核心有 index.html , index.js 和 App.js 这三个文件。
接下来主要详细介绍一下 index.js :
它是一个项目入口文件,也是我们重要的工作区域。 index.js 是和 index.html 文件关联的唯一接口。
index.js 的内容结构: