Skip to content

React序章 - 脚手架

脚手架

create-react-app 是一款一键生成简易 React 项目的脚手架工具,能快速体验 react 开发。

js
// 创建项目方式一:
$ npx create-react-app my-app

// 创建项目方式二:
// 1. 全局安装脚手架
$ npm i create-react-app -g
// 2. 使用脚手架创建react项目
$ create-react-app my-app

// 运行项目
$ cd my-app
$ npm run start

运行上述命令后,将会生成一个简单的 react 单页面项目。

参考: Create React App 中文文档