佳佳的博客
Menu
首页
First React
Posted by
佳佳
on 2018-04-24
IT
React
## 安装 1. 安装 `NPM` ([https://nodejs.org/en/download/](https://nodejs.org/en/download/ "https://nodejs.org/en/download/")) 2. 切换到淘宝的 `NPM` 镜像 ``` npm install -g cnpm --registry=https://registry.npm.taobao.org npm config set registry https://registry.npm.taobao.org ``` 3. 安装 `create-react-app` 模块,快速构建 `React` 开发环境 ``` cnpm install -g create-react-app create-react-app my-app cd my-app/ npm start ``` 4. 打开 [http://localhost:3000/](http://localhost:3000/) ## Hello, World 1. 修改 `src/App.js` 为如下内容,保存后之前打开的页面会自动刷新。 ```js import React, { Component } from 'react'; import logo from './logo.svg'; import './App.css'; class App extends Component { render() { return ( <h1>Hello, world!</h1> ); } } export default App; ```
版权声明:原创文章,未经允许不得转载。
https://www.liujiajia.me/2018/4/24/first-react
“Buy me a nongfu spring”
« Jenkins 自定义钉钉机器人消息
NPM »
昵称
*
电子邮箱
*
回复内容
*
(回复审核后才会显示)
提交
目录
AUTHOR
刘佳佳
江苏 - 苏州
软件工程师
梦嘉集团