how to use react-native-web and react-navigation together and access from web url

99封情书 提交于 2019-12-09 07:59:08

问题


UPDATE:

react-navigation web support is done. follow this: https://reactnavigation.org/docs/en/web-support.html

ORIGIN:

I try to share my code between react-native and web. when I try react-native-web, it works well. but there is only one question, how to access the specific screen from URL? I read the react-navigation docs, there nothing about that. and react-router-native can catch the web URL, but it has navigator likes StackNavigator/DrawerNavigator. and idea about that?


回答1:


I don't think it's possible as ReactNavigation is using an internal state object. Remember, it's mobile framework, it has no concept of URL routing. I also wanted to point out that even though RN claims web support you will need to be careful with component selection as not all the behaviours are identical (from memory, FlatList does not support touch scroll)



来源:https://stackoverflow.com/questions/49186634/how-to-use-react-native-web-and-react-navigation-together-and-access-from-web-ur

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!