Javascript 用导航来应对本机的困惑

Javascript 用导航来应对本机的困惑,javascript,reactjs,react-native,navigation,Javascript,Reactjs,React Native,Navigation,有谁能解释一下下面的例子中“导航”一词的错误吗 userByEmail(this.state.Email, navigate) // we call userByEmail ans pass email, but what does navigate do? 在这里,我了解到我们正在从screenProps中的auth导入/(解构这个.props)方法createUser??导航:{navigate}}它只是导航道具吗 const {screenProps: {auth: {createU

有谁能解释一下下面的例子中“导航”一词的错误吗

userByEmail(this.state.Email, navigate) // we call userByEmail ans pass email, but what does navigate do?

在这里,我了解到我们正在从screenProps中的auth导入/(解构这个.props)方法createUser??导航:{navigate}}它只是导航道具吗

 const {screenProps: {auth: {createUser}}, navigation: {navigate}} = this.props
最后,这两者的区别是什么

this.props.navigation.navigate('Calendar')
navigate('Calendar')

我不能完全用你的一些代码。但是如果
navigate
不是一个变量,则这是错误的

此.props.navigation

  • 设置
    路线
    时,
    导航道具
    会自动传递给 连接的屏幕
  • 如果未设置为直接布线,则应注入组件 通过将因子调用到
    反应导航
配置导航道具

  • 导航:转到另一个屏幕,找出需要执行的操作

  • goBack-关闭活动屏幕并在堆栈中向后移动

  • addListener-订阅导航生命周期的更新

  • isFocused—如果屏幕聚焦且 否则就错了

  • 状态-当前状态/路由

  • setParams-更改路由的参数

  • getParam-获取具有回退功能的特定参数

  • 调度-向路由器发送操作

您要使用的
“导航”
导航的道具