如何解决Uncaught TypeError: this.setState is not a function
2017-02-23 17:50
936 查看
如何解决Uncaught TypeError: this.setState is not a function?
解决办法:在执行this.setState这条语句时的上一层函数末尾加上.bind(this);
举个例子:
reader.onload = function(e) {
this.setState(...);
}.bind(this)
解决办法:在执行this.setState这条语句时的上一层函数末尾加上.bind(this);
举个例子:
reader.onload = function(e) {
this.setState(...);
}.bind(this)
相关文章推荐
- Uncaught TypeError: $(...).Validform is not a function 如何解决,以及其他方式替换jquery功能
- Uncaught TypeError: this.canvas.getContext is not a function
- chrome浏览器Uncaught TypeError: object is not a function问题解决
- 关于Uncaught TypeError: type is not a function at HTMLAnchorElement.onclick (indexjsp:71)的解决
- 关于react this.setState is not a function 的报错问题解决
- chrome浏览器Uncaught TypeError: object is not a function问题解决
- Uncaught TypeError: XXX is not a function解决
- Sea.js出现Uncaught TypeError: object is not a function的解决方法
- 使用vue时Module build failed: TypeError: this._init is not a function错误的解决方法
- chrome浏览器Uncaught TypeError: object is not a function问题解决
- 小程序之坑一TypeError: this.setData is not a function
- 解决Uncaught TypeError: object is not a function
- Uncaught TypeError: $.cookie is not a function 解决办法
- 关于Jquery错误的解决:Uncaught TypeError: $.post is not a function
- ExtJS 5.1 - tabpanel setActiveTab: Uncaught TypeError: c.isFocusable is not a function
- jQuery Validation插件onfocosout/onkeyup出错的解决方法[Uncaught TypeError: undefined is not a function中文资料不好找]
- jquery中Uncaught TypeError: $(...).ajaxUpload is not a function(…)错误解决方法
- 论微信小程序的坑:thirdScriptError TypeError: this.setData is not a function
- JS报错 Uncaught TypeError: undefined is not a function,解决
- Backbone 或 jQuery 出错,异常:Uncaught TypeError: object is not a function