如何解决Uncaught TypeError: this.setState is not a function?
解决办法:在执行this.setState这条语句时的上一层函数末尾加上.bind(this);
举个例子:
reader.onload = function(e) {
this.setState(...);
}.bind(this)
最后
以上就是甜甜嚓茶最近收集整理的关于如何解决Uncaught TypeError: this.setState is not a function的全部内容,更多相关如何解决Uncaught内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复