问题描述
我想调用一个函数,该函数应基于getDerivedStateFromProps()
返回的数据执行
static getDerivedStateFromProps(nextprops,prevstate) {
return {
value: nextprops.value
}
this.`sampleFunction()` // which is not possible after return statement
}
但是sampleFunction()
的执行仅基于从getDerivedStateFromProps()
返回的数据。
因此,有人可以让我知道如何实现这一目标吗?谢谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)