首页
移动开发
物联网
服务端
编程语言
企业开发
数据库
业界资讯
其他
搜索
react报错:Cannot read property ‘setState‘ of undefined
其他
2021-02-08 15:18:19
阅读次数: 0
错误如下:
代码如下:
原因是this已经不是当前组件的this了,可以在方法里加一个bind改变this的指向
猜你喜欢
转载自
blog.csdn.net/joyvonlee/article/details/108870387
React 报错"Cannot read property 'setState' of undefined"
react报错:Cannot read property ‘setState‘ of undefined
react报错 TypeError: Cannot read property 'setState' of undefined
Cannot read property 'setState' of undefined错误分析
React-Cannot read property 'state' of undefined at handleClick 报错原因
react跳转路由报错Cannot read property ‘push’ of undefined
react报错:Cannot read property ‘forEach‘ of undefined at Object.injectIntoGlobalHoo
React PropTypes Cannot read property 'string' of undefined
react native cannot read property 'navigate' of undefined
Cannot read property 'length' of undefined报错
vue报错Cannot read property 'component' of undefined
layui报错Cannot read property 'colspan' of undefined
报错 Cannot read property 'settings' of undefined
Cannot read property 'defaultView' of undefined 报错解决
axios报错: Cannot read property 'protocol' of undefined ....
jstree报错 Cannot read property 'state' of undefined
antd 报错 Cannot read property 'filter' of undefined
js报错Cannot read property 'length' of undefined
vue报错 Cannot read property ‘_wrapper‘ of undefined
vue 报错 Cannot read property ‘_wrapper‘ of undefined
mCustomScrollbar报错Cannot read property ‘autoUpdate‘ of undefined
【报错】TypeError: Cannot read property ‘url‘ of undefined
Cannot read property '0' of undefined
Cannot read property 'nodeType' of undefined
Cannot read property 'forEach' of undefined
Cannot read property 'matched' of undefined"
Cannot read property 'mergeConfig' of undefined
Cannot read property 'xxx' of undefined
Cannot read property 'newLine' of undefined
Cannot read property 'tap' of undefined
今日推荐
周排行
TryParse的使用方法小结
Android之高仿手机QQ聊天
关于在java中关键字private能否用来修饰类的问题
去雾算法总结
前端面试题:事件防抖,函数节流,事件防抖和函数节流的区别
随堂小测
【OpenCV + Python】归一化函数cv2.normalize()的原理讲解
05: redis 主从复制
python3-基础5
持续更新-使用 Maven Module 搭建spring boot项目(整合Spring Security、Spring Social、spring OAuth)第一篇
每日归档
更多
2025-03-18(0)
2025-03-17(0)
2025-03-16(0)
2025-03-15(0)
2025-03-14(0)
2025-03-13(0)
2025-03-12(0)
2025-03-11(0)
2025-03-10(0)
2025-03-09(0)