使用反应导航中的重置操作导航到其他导航器

时间:2019-02-21 17:51:16

标签: javascript reactjs react-native react-redux react-navigation

我当前的结构是

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,但它返回未定义的路由错误。

0 个答案:

没有答案