{"action":"created","issue":{"url":"https://api.github.com/repos/react-navigation/react-navigation/issues/2565","repository_url":"https://api.github.com/repos/react-navigation/react-navigation","labels_url":"https://api.github.com/repos/react-navigation/react-navigation/issues/2565/labels{/name}","comments_url":"https://api.github.com/repos/react-navigation/react-navigation/issues/2565/comments","events_url":"https://api.github.com/repos/react-navigation/react-navigation/issues/2565/events","html_url":"https://github.com/react-navigation/react-navigation/issues/2565","id":256581881,"number":2565,"title":"Nested navigators Stack1->Drawer->Stack2 don't allow go back to Stack1","user":{"login":"Jose-Gallegos","id":31838675,"avatar_url":"https://avatars2.githubusercontent.com/u/31838675?v=4","gravatar_id":"","url":"https://api.github.com/users/Jose-Gallegos","html_url":"https://github.com/Jose-Gallegos","followers_url":"https://api.github.com/users/Jose-Gallegos/followers","following_url":"https://api.github.com/users/Jose-Gallegos/following{/other_user}","gists_url":"https://api.github.com/users/Jose-Gallegos/gists{/gist_id}","starred_url":"https://api.github.com/users/Jose-Gallegos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jose-Gallegos/subscriptions","organizations_url":"https://api.github.com/users/Jose-Gallegos/orgs","repos_url":"https://api.github.com/users/Jose-Gallegos/repos","events_url":"https://api.github.com/users/Jose-Gallegos/events{/privacy}","received_events_url":"https://api.github.com/users/Jose-Gallegos/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2017-09-11T04:58:28Z","updated_at":"2018-03-07T13:11:15Z","closed_at":"2017-09-11T20:02:27Z","author_association":"NONE","body":"I have a complex navigation structure, where I have a initial StackNavigator for Login screen, after that I have a DrawerNavigator, and then each drawer option is a StackNavigator for showing a header.\r\n\r\n```\r\nconst SearchAnimalStack = StackNavigator(\r\n  {\r\n    SearchAnimal: {\r\n      screen: SearchAnimalScreen,\r\n      navigationOptions: ({ navigation}) => ({\r\n        headerLeft: <DrawerButton navigation={navigation}  />\r\n      }),\r\n    }\r\n  },\r\n  {\r\n    navigationOptions: ({ navigation}) => ({\r\n      drawerLabel: \"Buscar Animal\",\r\n      headerTitle: \"Buscar Animal\",\r\n      headerTintColor: '#407a4f',\r\n      headerStyle: {\r\n            backgroundColor: '#58b076',\r\n      },\r\n    }),\r\n  }\r\n);\r\n\r\n\r\nconst RegisterAnimalStack = StackNavigator(\r\n  {\r\n    RegisterAnimal: {\r\n      screen: RegisterAnimalScreen,\r\n      navigationOptions: ({ navigation}) => ({\r\n        headerLeft: <DrawerButton navigation={navigation}  />\r\n      }),\r\n    }\r\n  },\r\n  {\r\n    navigationOptions: ({ navigation}) => ({\r\n      drawerLabel: \"Registrar Animal\",\r\n      headerTitle: \"Registrar Animal\",\r\n      headerTintColor: '#407a4f',\r\n      headerStyle: {\r\n            backgroundColor: '#58b076',\r\n      },\r\n    }),\r\n  }\r\n);\r\n\r\nconst SignedInDrawer = DrawerNavigator({\r\n    SearchAnimal: { screen: SearchAnimalStack,\r\n      navigationOptions: {\r\n        drawerLabel: \"Buscar Animal\",\r\n      }\r\n    },\r\n    RegisterAnimal: { screen: RegisterAnimalScreen,\r\n      navigationOptions: {\r\n        drawerLabel: \"Registrar Animal\",\r\n      }\r\n    },\r\n    Profile: { screen: ProfileScreen,\r\n      navigationOptions: {\r\n        drawerLabel: \"Perfil\",\r\n      }\r\n    },\r\n  }\r\n);\r\n\r\nconst BovinoAppStack = StackNavigator({\r\n    Login: { screen: LoginScreen },\r\n    SignedInDrawer: {screen: SignedInDrawer },\r\n  },\r\n  {\r\n    headerMode: \"none\",\r\n  }\r\n);\r\n```\r\n\r\nI'm trying to have a Logout button on ProfileScreen  like this:\r\n\r\n```\r\n  logout() {\r\n    const { dispatch } = this.props.navigation;\r\n    dispatch(NavigationActions.reset( { index: 0, actions: [ NavigationActions.navigate({routeName: 'Login', params: { noAutologin: true }})]}));\r\n  }\r\n\r\n<TouchableOpacity style={styles.simpleButton} onPress={() => {this.logout()}}>\r\n          <Text style={styles.buttonText}>Cerrar sesión <FontAwesome>{Icons.signOut}</FontAwesome></Text>\r\n</TouchableOpacity>\r\n```\r\n\r\nBut when I click the button there is an error: \"There is no route defined for key Login. Must be one of: 'SearchAnimal'\r\n\r\nThe expected behavior is to go back to LoginScreen.\r\n\r\n\r\n| software         | version\r\n| ---------------- | -------\r\n| react-navigation | 1.0.0-beta.12\r\n| react-native     | 0.48.2\r\n| node             | v7.7.0\r\n| npm or yarn      | npm 4.1.2\r\n"},"comment":{"url":"https://api.github.com/repos/react-navigation/react-navigation/issues/comments/371133520","html_url":"https://github.com/react-navigation/react-navigation/issues/2565#issuecomment-371133520","issue_url":"https://api.github.com/repos/react-navigation/react-navigation/issues/2565","id":371133520,"user":{"login":"rochapablo","id":5365304,"avatar_url":"https://avatars1.githubusercontent.com/u/5365304?v=4","gravatar_id":"","url":"https://api.github.com/users/rochapablo","html_url":"https://github.com/rochapablo","followers_url":"https://api.github.com/users/rochapablo/followers","following_url":"https://api.github.com/users/rochapablo/following{/other_user}","gists_url":"https://api.github.com/users/rochapablo/gists{/gist_id}","starred_url":"https://api.github.com/users/rochapablo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rochapablo/subscriptions","organizations_url":"https://api.github.com/users/rochapablo/orgs","repos_url":"https://api.github.com/users/rochapablo/repos","events_url":"https://api.github.com/users/rochapablo/events{/privacy}","received_events_url":"https://api.github.com/users/rochapablo/received_events","type":"User","site_admin":false},"created_at":"2018-03-07T13:11:15Z","updated_at":"2018-03-07T13:11:15Z","author_association":"NONE","body":"@graig12, I just add all in one `DrawerNavigator`:\r\n\r\n```\r\nexport const AppNavigator = DrawerNavigator(\r\n  {\r\n    Login: { screen: Login },\r\n    ...\r\n  },\r\n  {\r\n    ...settings,\r\n    navigationOptions: {\r\n      drawerLockMode: 'locked-closed'\r\n    },\r\n    drawerPosition: ...,\r\n    contentComponent: ...,\r\n    initialRouteName: '...'\r\n  }\r\n)\r\n```\r\n\r\nIt's not what I wanted, but it's working for now."}}
{"actor":{"display_login":"rochapablo"}}