TypeError: Cannot read property 'searchField' of undefined
Function.mapStateToProps [as mapToProps]
C:/Users/windw/Desktop/robofriends/src/containers/App.js:11
8 |
9 | const mapStateToProps = state => {
10 | return {
> 11 | searchField: state.searchRobots.searchField
12 | }
13 | }
14 |
最佳答案
用这个 搜索字段:state.searchField 代替 搜索字段:state.searchRobots.searchField
并且您的讲师还将在视频的后面部分指导您删除searchRobots。
关于javascript - react 类型错误 : Cannot read property 'searchField' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55283689/