gpt4 book ai didi

javascript - react 类型错误 : Cannot read property 'searchField' of undefined

转载 作者:行者123 更新时间:2023-11-30 14:06:29 25 4
gpt4 key购买 nike

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 |

Code Part

最佳答案

用这个 搜索字段:state.searchField 代替搜索字段:state.searchRobots.searchField

并且您的讲师还将在视频的后面部分指导您删除searchRobots。

关于javascript - react 类型错误 : Cannot read property 'searchField' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55283689/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com