摘要: 注释掉 this.setState({val: this.state.val + 6}) 时:不注释掉 this.setState({val: this.state.val + 6}) 时: import React, { Component } from ... 阅读全文
posted @ 2018-11-22 12:04 徐同保 阅读(148) 评论(0) 推荐(0) 编辑
摘要: setState 通过引发一次组件的更新过程来引发重新绘制setState 方法被调用时,会引起 React 的 4 个生命周期的函数被调用: shouldComponentUpdate (this.state 没有得到更新) componentWillU... 阅读全文
posted @ 2018-11-22 11:36 徐同保 阅读(116) 评论(0) 推荐(0) 编辑