Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and 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 Reply

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...