javascript - 获取 TypeError:无法读取未定义的属性“句柄”,但无法弄清楚原因
问题描述
我目前正在关注 FCC 频道上的 youtube 应用程序课程。一切都很好,我即将完成它,但是自从在应用程序的客户端工作中途以来,我遇到了一个问题。我不断得到TypeError: Cannot read property 'handle' of undefined
它,它在以下代码中突出显示“凭据”:
render () {
const {
classes,
user: {
credentials: { handle, createdAt, imageUrl, bio, website, location },
loading,
authenticated,
},
} = this.props;
我不知道为什么,我尝试了其他用户找到的几种解决方案,但无济于事。这是我在 github “https://github.com/HelmutKaltsburg/socialize-client”上的工作的链接,以下 js 文件中有错误“https://github.com/HelmutKaltsburg/socialize-client/blob/主/src/components/profile/Profile.js"
编辑:我检查了我的 redux 状态,在用户登录后“已验证”变为真,但“凭据”没有,并且在错误消息显示凭据全部加载后,因此我留在错误消息中并有手动转到 localhost:3000/home
解决方案
推荐阅读
- flutter - Flutter - 将 orElse 添加到 FirstWhere
- angular - 如何获取已创建记录的 ID?
- java - 如何从 MethodArgumentNotValidException 类中提取字段名称和错误消息?
- c# - 如何在单元测试中验证 EF Core DBContext 配置
- .net-core - Identity Server 4 上的关联失败
- python - 在 Docker 中使用 PYTHONDONTWRITEBYTECODE 有什么缺点吗?
- python - 表子集列的连接将返回对象而不是 sqlalchemy 上的数据
- avro - Avro 架构不兼容
- matlab - MATLAB 是否能够与 Unix 域套接字通信?
- snowflake-cloud-data-platform - 存储过程中日期格式的 snwoflake 问题