React的componentWillReceiveProps(nextProps)生命周期使用详解

官方文档解释:https://developmentarc.gitbooks.io/react-indepth/content/life_cycle/update/component_will_receive_props.htmljavascript 该方法当props发生变化时执行,初始化render时不执行,在这个回调函数里面,你能够根据属性的变化,经过调用this.setState()来更新
相关文章
相关标签/搜索