我当前的结构是
const AppNavigator = createSwitchNavigator({
AuthLoading,
MainNavigator,
AuthNavigator
},
{
initialRouteName: 'AuthLoading'
});
AuthNavigator
const OtpVerificationStack = createSwitchNavigator({
OTPLoading,
SignupNavigator,
MainNavigator
},
{
initialRouteName: 'OTPLoading',
});
const AuthNavigator = createStackNavigator({
VerificationNavigator,
OtpVerificationStack
},
{
initialRouteName: 'VerificationNavigator',
header: null,
headerMode: 'none'
});
VerificationNavigator
const VerificationNavigator = createStackNavigator({
MobileNo,
OTPVer
},
{
header: null,
headerMode: 'none'
});
当我从AuthNavigator-> VerificationNavigator(从otpver屏幕转到otpverificationStack)-> OTPVerificationStack-> SignupNavigator(屏幕1)注册用户时,这里有一个google登录选项,因此当有人使用此登录时,我需要重置路由到MainNavigator。 我在分配resetAction时尝试了kee [ing key null或MainNavigator,但它返回未定义的路由错误。