摘要: import React, { Component } from "react"; export class TestHanderClick extends Component { constructor(props) { super(props); this.state = { cont: "内容 阅读全文
posted @ 2020-08-17 23:15 何人陪我共长生 阅读(422) 评论(0) 推荐(0)
摘要: 执行如下: npm install -g react npm install react --save 类似这种依赖项(react,react-dom 等)报错,哪个报错执行哪个即可 执行上述两句就 ok 啦 阅读全文
posted @ 2020-08-17 22:58 何人陪我共长生 阅读(1769) 评论(0) 推荐(0)
摘要: 我发现 state 有两种不同的写法 在构造器 constructor 中是这样的 有 this. constructor(props){//参数必须要有 super(props); this.state={ num:10 } } } 没有 constructor state={ num:10 } 阅读全文
posted @ 2020-08-17 22:57 何人陪我共长生 阅读(464) 评论(0) 推荐(0)
摘要: 现在安装 react 脚手架的有三种, react-boilerplate react-redux-starter-kit create-react-app(国内主要运用这一种) 1==>npm install -g create-react-app 全局安装脚手架命令(第一次安装后就不需要在重新安 阅读全文
posted @ 2020-08-17 22:54 何人陪我共长生 阅读(839) 评论(0) 推荐(0)
摘要: import React, { Component } from "react"; export class TestHanderClick extends Component { //有构造器state写在里面, 构造器中必须要有super并且传递参数 constructor(props) { s 阅读全文
posted @ 2020-08-17 22:51 何人陪我共长生 阅读(1053) 评论(0) 推荐(0)