JavaShuo
欄目
標籤
React踩坑:TypeError Cannot read property props of undefined
時間 2021-01-17
標籤
react
javascript
欄目
React
简体版
原文
原文鏈接
錯誤:點擊按鈕以後想要視情況跳轉頁面,但是用this.props.history.push()的時候報錯TypeError: Cannot read property ‘props’ of undefined 錯誤原因:沒有給函數綁定this,函數內部引用this的時候無法解析出this,也就得不到this的屬性props了。 解決方法:在組件的構造函數constructor中添加: this.函
>>阅读原文<<
相關文章
1.
react報錯 TypeError: Cannot read property 'setState' of undefined
2.
TypeError: Cannot read property 'compilation' of undefined
3.
"TypeError: Cannot read property ‘_wrapper’ of undefined"
4.
TypeError: Cannot read property 'key' of undefined
5.
TypeError Cannot read property ‘nativeElement’ of undefined
6.
TypeError: Cannot read property 'split' of undefined
7.
TypeError: Cannot read property 'getUserMedia' of undefined
8.
TypeError: Cannot read property '$createElement' of undefined
9.
TypeError: Cannot read property 'toString' of undefined
10.
TypeError: Cannot read property 'gc' of undefined
更多相關文章...
•
ASP Read 方法
-
ASP 教程
•
ADO Property 對象
-
ADO 教程
•
爲了進字節跳動,我精選了29道Java經典算法題,帶詳細講解
•
PHP Ajax 跨域問題最佳解決方案
相關標籤/搜索
typeerror
踩坑
property
undefined
props
React踩坑指南
read
read%
踩坑日記
踩坑之旅
React
JavaScript
Spring教程
0
分享到微博
分享到微信
分享到QQ
每日一句
每一个你不满意的现在,都有一个你没有努力的曾经。
最新文章
1.
以實例說明微服務拆分(以SpringCloud+Gradle)
2.
idea中通過Maven已經將依賴導入,在本地倉庫和external libraries中均有,運行的時候報沒有包的錯誤。
3.
Maven把jar包打到指定目錄下
4.
【SpringMvc】JSP+MyBatis 用戶登陸後更改導航欄信息
5.
在Maven本地倉庫安裝架包
6.
搭建springBoot+gradle+mysql框架
7.
PHP關於文件$_FILES一些問題、校驗和限制
8.
php 5.6連接mongodb擴展
9.
Vue使用命令行創建項目
10.
eclipse修改啓動圖片
本站公眾號
歡迎關注本站公眾號,獲取更多信息
相關文章
1.
react報錯 TypeError: Cannot read property 'setState' of undefined
2.
TypeError: Cannot read property 'compilation' of undefined
3.
"TypeError: Cannot read property ‘_wrapper’ of undefined"
4.
TypeError: Cannot read property 'key' of undefined
5.
TypeError Cannot read property ‘nativeElement’ of undefined
6.
TypeError: Cannot read property 'split' of undefined
7.
TypeError: Cannot read property 'getUserMedia' of undefined
8.
TypeError: Cannot read property '$createElement' of undefined
9.
TypeError: Cannot read property 'toString' of undefined
10.
TypeError: Cannot read property 'gc' of undefined
>>更多相關文章<<