反应本机堆栈导航
React Native Stack Navigation
我有 ComponentOne,它是 ComponentTwo 的父级。
然后我有 ComponentThree 和 ComponentFour。
问题是我可以轻松地在 ComponetOne 到 ComponentThree 和 ComponentFour 之间导航,但是我无法从 ComponentTwo 中的按钮导航,它是 ComponentOne 的子项,我在 React Native 中使用 Stack Navigation,
错误:评估(this.props.navigator)未定义不是对象
我试过在 ComponentTwo 的不同地方声明 const {navigator} 但似乎没有任何帮助
帮助将不胜感激。 :)
我很幸运,刚刚通过了
作为 ComponetTwo 的道具,现在可以使用了:)
我认为我们需要将导航引用作为道具传递给子组件,以便从子组件访问它。
谢谢,
我有 ComponentOne,它是 ComponentTwo 的父级。 然后我有 ComponentThree 和 ComponentFour。 问题是我可以轻松地在 ComponetOne 到 ComponentThree 和 ComponentFour 之间导航,但是我无法从 ComponentTwo 中的按钮导航,它是 ComponentOne 的子项,我在 React Native 中使用 Stack Navigation, 错误:评估(this.props.navigator)未定义不是对象
我试过在 ComponentTwo 的不同地方声明 const {navigator} 但似乎没有任何帮助 帮助将不胜感激。 :)
我很幸运,刚刚通过了 作为 ComponetTwo 的道具,现在可以使用了:) 我认为我们需要将导航引用作为道具传递给子组件,以便从子组件访问它。 谢谢,