我是靠谱客的博主 激动小甜瓜,这篇文章主要介绍关于Uncaught TypeError: nt.setState.bind is not a function报错解决,现在分享给大家,希望可以做个参考。

错误代码如下:

复制代码
1
2
3
4
5
1 show = (arg1, arg2) => { 2 this.setState = '456' + arg1 +arg2 3 }

setState是个方法,这里变成给this(实例)添加属性,手误报错!!!

正确代码如下:

复制代码
1
2
3
4
5
6
7
8
9
1 show = (arg1, arg2) => { 2 this.setState({ 3 msg: '456' + arg1 +arg2 4 }) 5 }

 

转载于:https://www.cnblogs.com/minyDong/p/10859471.html

最后

以上就是激动小甜瓜最近收集整理的关于关于Uncaught TypeError: nt.setState.bind is not a function报错解决的全部内容,更多相关关于Uncaught内容请搜索靠谱客的其他文章。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部