首页
移动开发
物联网
服务端
编程语言
企业开发
数据库
业界资讯
其他
搜索
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
今日推荐
周排行
Sping整合ActiveMQ(五.常见错误分析)
jquery ajax发送请求实例模板
北风设计模式课程---24、迭代模式
[Luogu] 兽径管理
1030 Travel Plan (30 分)(dijkstra算法+dfs+边权)
springboot-shiro中的问题
数据访问安全代理 CASB
RocketMQ与Kafka对比
Rider 2019.3.3 发布,跨平台 .NET IDE
Ubuntu切换root su -
每日归档
更多
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)
2025-03-08(0)