Я использую реагирующую навигацию, чтобы создать боковое меню для моего приложения.Я временно использую метод Logoff (), чтобы открыть меню.Я на 90% уверен, что метод toggleDrawer () работает правильно. Проблема: Если выбрано, приложение по умолчанию настроено на Экран настроек.Он не открывает ящик.
import MainAppNavigator from './MainAppNavigator';
import WorkingEmailScreen from '../containers/EmailScreenContainer';
import WorkingPasswordScreen from '../containers/PasswordScreenContainer';
import WorkingAuthLoadingScreen from '../containers/AuthLoadingScreenContainer';
import WorkingConfirmRegisterScreen from '../containers/ConfirmRegisterScreenContainer';
import WorkingSplashScreen from '../containers/SplashScreenContainer';
import WorkingLoginScreen from '../containers/LoginScreenContainer';
import WorkingResetPasswordScreen from '../containers/ResetPasswordScreenContainer';
import SettingsScreen from '../screens/SettingsScreen';
import SideMenuDrawer from '../screens/SideMenuDrawer';
const RegistrationStack = createStackNavigator({
Email: WorkingEmailScreen,
Password: WorkingPasswordScreen,
Confirm: WorkingConfirmRegisterScreen,
});
const SettingsStack = createStackNavigator({
Settings: SettingsScreen,
});
const SideMenuNavigator = createDrawerNavigator({
Settings: {
screen: SettingsStack,
navigationOptions: {
drawerLabel: 'Demo Screen 1',
},
},
Password: {
screen: WorkingPasswordScreen,
navigationOptions: {
drawerLabel: 'Demo Screen 2',
},
},
}, {
contentComponent: SideMenuDrawer,
});
export default createSwitchNavigator({
AuthLoading: WorkingAuthLoadingScreen,
App: MainAppNavigator,
Auth: RegistrationStack,
Splash: WorkingSplashScreen,
Login: WorkingLoginScreen,
ResetPassword: WorkingResetPasswordScreen,
SideMenu: SideMenuNavigator,
},
{
initialRouteName: 'AuthLoading',
});
MainScreen.js
// this.props.navigation.dispatch(DrawerActions.toggleDrawer());
this.props.navigation.dispatch(DrawerActions.toggleDrawer())
}