我越来越不确定是不是一个对象(评估'this.props.navigation.navigate') [英] I am getting undefined is not an object (evaluating 'this.props.navigation.navigate')

查看:80
本文介绍了我越来越不确定是不是一个对象(评估'this.props.navigation.navigate')的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

firebase.notifications().onNotificationOpened((notificationOpen) => {
const { notification } = notificationOpen;
notification.android.setChannelId('notificationId');
this.props.navigation.navigate("LoginScreen");});

我在React Native中单击Firebase通知时遇到的不确定对象不是对象(评估'navigation.navigate')的问题

I am facing issues of undefined is not an object (evaluating 'navigation.navigate') while clicking on firebase notification in react native

推荐答案

没有任何更多信息,该错误就很明显.您正在尝试获取名为 navigation 的内容属性.但是,在这种情况下,它是未定义的或不可访问的.

Without any futher informations, the error is clear. You're trying to get a property of your content called navigation. But, in this context, it's not defined or not accessible.

要获取属性的内容,请确保在您的内容中清楚地定义了该属性,并且可以在函数内部对其进行访问.
然后,您应该可以使用与您的财产相关的函数 navigate('LoginScreen').

To get the content of your property, make sure it's defined clearly in your content and accessible inside of your function .
Then you should be able to use the function navigate('LoginScreen') related to your property.

这篇关于我越来越不确定是不是一个对象(评估'this.props.navigation.navigate')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆