【问题标题】:React Native Stack Navigation反应本机堆栈导航
【发布时间】:2017-09-04 18:04:39
【问题描述】:

我有 ComponentOne,它是 ComponentTwo 的父级。 然后我有 ComponentThree 和 ComponentFour。 问题是我可以轻松地在 ComponetOne 到 ComponentThree 和 ComponentFour 之间导航,但是我无法从 ComponentTwo 中的按钮导航,它是 ComponentOne 的子级,我在 React Native 中使用 Stack Navigation, 错误:评估(this.props.navigator)未定义不是对象

我尝试在 ComponentTwo 的不同位置声明 const {navigator},但似乎没有任何帮助 帮助将不胜感激。 :)

【问题讨论】:

  • 没有任何代码很难帮助

标签: javascript android reactjs native


【解决方案1】:

我很幸运,刚刚通过了 作为 ComponetTwo 的一个道具,它现在可以工作了 :) 我认为我们需要将导航引用作为道具传递给子组件以从子组件访问它。 谢谢,

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-10-16
    • 2019-12-16
    • 2023-01-27
    • 2018-05-16
    • 2020-01-28
    • 1970-01-01
    • 2020-09-30
    • 2018-05-18
    相关资源
    最近更新 更多