Javascript 反应本机堆栈导航
我有ComponentOne,它是ComponentTwo的父级。 然后我有组件三和组件四。 问题是我可以轻松地在ComponentOne到ComponentThree和ComponentFour之间导航,但我无法从ComponentTwo中的按钮导航,该按钮是ComponentOne的子项,我在React Native中使用堆栈导航, 错误:评估(this.props.navigator)未定义不是对象 我曾尝试在ComponentTwo的不同位置声明const{navigator},但似乎没有任何效果Javascript 反应本机堆栈导航,javascript,android,reactjs,native,Javascript,Android,Reactjs,Native,我有ComponentOne,它是ComponentTwo的父级。 然后我有组件三和组件四。 问题是我可以轻松地在ComponentOne到ComponentThree和ComponentFour之间导航,但我无法从ComponentTwo中的按钮导航,该按钮是ComponentOne的子项,我在React Native中使用堆栈导航, 错误:评估(this.props.navigator)未定义不是对象 我曾尝试在ComponentTwo的不同位置声明const{navigator},但似乎没
非常感谢您的帮助。:) 我运气不错,刚通过考试 作为ComponetTwo的道具,它现在可以工作了:) 我认为我们需要将导航引用作为道具传递给子组件,以便从子组件访问它。
谢谢,没有任何代码很难帮助您