问题
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