我是靠谱客的博主 甜甜嚓茶,这篇文章主要介绍如何解决Uncaught TypeError: this.setState is not a function,现在分享给大家,希望可以做个参考。

如何解决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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(65)

评论列表共有 0 条评论

立即
投稿
返回
顶部