react.js - React componentWillReceiveProps问题
本文介绍了react.js - React componentWillReceiveProps问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
我有个props值是根据一个state回调的,现在我要在componentWillReceiveProps里面判断这个props做处理,结果props总是上一个状态
我要做一个发送验证码后60秒定时器,一般怎么启动呢,我现在是提交事件里面函数回调给父组件,再传给按钮这个组件,就有现在这个问题
解决方案
componentWillReceiveProps(nextProps){
this.props //当前的props
nextProps //下一阶段的props
}
这篇关于react.js - React componentWillReceiveProps问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文