将参数从Child Tab-Navigator屏幕传递到父stack-navigator屏幕|反应本机导航
我有嵌套导航器的问题: 我想将参数从(子导航器) tab-navigator 屏幕传递给(父导符) stack-navigator 带有反应导航 v6 的屏幕。
我的导航结构看起来像这样:
< STACK NAVIGATOR >: : parent navigator
< some screens here .. />
*< screen which will receive the params />
< TAB NAVIGATOR > : child navigator
< some screens here .. />
*< screen which will send params />
</ TAB NAVIGATOR** >
</ **STACK NAVIGATOR** >
我不知道是否有一个内置的方式可以通过反应进行操作,尽管我确实搜索了一点,并且在文档中什么也没有发现,所以如果有任何有用的见解,我会是非常感谢。
I have this problem with nested navigators:
I want to pass params from a (child navigator) tab-navigator screen to a (parent navigator)
stack-navigator screen with react navigation v6.
my navigation structure looks like this:
< STACK NAVIGATOR >: : parent navigator
< some screens here .. />
*< screen which will receive the params />
< TAB NAVIGATOR > : child navigator
< some screens here .. />
*< screen which will send params />
</ TAB NAVIGATOR** >
</ **STACK NAVIGATOR** >
I don't know if there is a built in way to do it with react-navigation, although I did search a bit and found nothing in the docs so if there is any helpful insights, I would be very thankful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使全球状态通过儿童组成部分。
并确保将组件加载到屏幕上
&lt; stack.screen&gt;
/ *您的组件并按照下面说明的 */
&lt;/stact.screen&gt;
对你的孩子
You can make a global state to pass outside of the Child component
and make sure that loading of component to screen is inside
<Stack.Screen>
/* your component and spread the props as stated below */
</Stact.Screen>
and on your child