Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

react-native - 如何将Context Provider与导航器连接(How to connect Context Provider with the Navigators)

I just wonder if there is a similar way to connect our provider with the navigators, switchNavigator in my case, with the way we do with Redux-connect.

(我只是想知道是否有一种类似的方式将我们的提供程序与导航器连接起来,在本例中为switchNavigator,与我们对Redux-connect的连接方式一样。)

I have my global context provider in which I store the my states, and want to use the context variables in my createXNavigator objects.

(我有一个全局上下文提供程序,用于存储状态,并希望在createXNavigator对象中使用上下文变量。)

Thanks.

(谢谢。)

  ask by Bora Sumer translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I have solved it using navigatorRef method.

(我已经解决了使用navigatorRef方法。)

You can see the documentation here;

(您可以在此处查看文档;)

Navigating without the navigation prop

(在没有导航道具的情况下进行导航)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...