我的导航结构如下:
const App = () => {
const prefix = 'test://';
return <AppNavigator uriPrefix={prefix} />;
};
const AppNavigator = createSwitchNavigator({
splash: SplashScreen,
auth: AuthStack,
main: HomeStack,
});
const AuthStack = createStackNavigator({
landing: LandingScreen,
login: {
screen: LoginScreen,
path: 'page/login',
},
register: {
screen: RegisterScreen,
path: 'page/signup',
},
});
const HomeStack = createStackNavigator({
home: HomeScreen,
details: {
screen: DetailsScreen,
path: 'details/:assetId',
},
upsell: {
screen: UpsellScreen,
path: 'page/upsell',
},
});
我的深度链接URI如下:
test://page/login
test://page/signup
test://details/12345
test://page/upsell
当链接到这些URI中的任何一个时,我总是被带到我的应用程序的第一个屏幕SplashScreen
。如何正确地链接到嵌套的导航器并链接到正确的屏幕?