{{ message }}
react hello world
// 安装环境
npm install -g cnpm --registry=https://registry.npm.taobao.org
npm config set registry https://registry.npm.taobao.org
cnpm install -g create-react-app
// 建立react项目
npx create-react-app my-app
cd my-app
npm start
// 修改App.js文件,加入个性化元素
// App.js是程序的入口,在这里面可以引用其它的模块(组件Component)
import React, { Component } from "react";
import "./App.css";
class App extends Component {
constructor(props) {
super(props);
this.state = {
total: 0,
next: null,
operation: null
};
}
render() {
return (
hello world!
总数:{this.state.total}
