{"action":"closed","issue":{"url":"https://api.github.com/repos/react-community/react-navigation/issues/3169","repository_url":"https://api.github.com/repos/react-community/react-navigation","labels_url":"https://api.github.com/repos/react-community/react-navigation/issues/3169/labels{/name}","comments_url":"https://api.github.com/repos/react-community/react-navigation/issues/3169/comments","events_url":"https://api.github.com/repos/react-community/react-navigation/issues/3169/events","html_url":"https://github.com/react-community/react-navigation/issues/3169","id":283892308,"number":3169,"title":"How to handle back button in stack navigator having drawer nested inside.","user":{"login":"sfm2222","id":34582575,"avatar_url":"https://avatars0.githubusercontent.com/u/34582575?v=4","gravatar_id":"","url":"https://api.github.com/users/sfm2222","html_url":"https://github.com/sfm2222","followers_url":"https://api.github.com/users/sfm2222/followers","following_url":"https://api.github.com/users/sfm2222/following{/other_user}","gists_url":"https://api.github.com/users/sfm2222/gists{/gist_id}","starred_url":"https://api.github.com/users/sfm2222/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfm2222/subscriptions","organizations_url":"https://api.github.com/users/sfm2222/orgs","repos_url":"https://api.github.com/users/sfm2222/repos","events_url":"https://api.github.com/users/sfm2222/events{/privacy}","received_events_url":"https://api.github.com/users/sfm2222/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-12-21T14:06:40Z","updated_at":"2017-12-22T16:57:55Z","closed_at":"2017-12-22T16:57:55Z","author_association":"NONE","body":"I have a Drawer nested inside of the stack. Unable to implement the back button using it. Can anyone provide a clean solution to resolve this =(\r\n\r\nI want to show back button on top on iOS and on android navigate to last screen using hardware back button.\r\n\r\n**Drawer Navigator**\r\n```\r\n\r\n/* @flow */\r\n\r\nimport React from \"react\";\r\nimport { DrawerNavigator } from \"react-navigation\";\r\n\r\nimport Home from \"./components/home/\";\r\nimport SplashPage from \"./components/splashscreen/\";\r\nimport SideBar from \"./components/sidebar\";\r\nimport Contact from \"./components/Contact/\";\r\n\r\n\r\n\r\nconst Drawer = DrawerNavigator(\r\n  {\r\n   Home: { screen: Home },\r\n    Contact: { screen: Contact},\r\n  },\r\n  {\r\n    navigationOptions: {\r\n      gesturesEnabled: false\r\n    },\r\n  initialRouteName: \"Home\",\r\n    contentOptions: {\r\n      activeTintColor: \"#e91e63\"\r\n    },\r\n    drawerPosition: 'right',\r\n    contentComponent: props => <SideBar {...props} />\r\n  }\r\n);\r\n\r\n\r\n\r\nexport default Drawer;\r\n```\r\n**Stack Navigator**\r\n```\r\n\r\n/* @flow */\r\n\r\nimport React from \"react\";\r\n\r\nimport { Platform } from \"react-native\";\r\nimport { Root } from \"native-base\";\r\nimport { StackNavigator} from \"react-navigation\";\r\nimport Drawer from \"./Drawer\";\r\nimport Contact from \"./components/Contact\"\r\nimport Register from \"./components/Register\"\r\nimport Home from \"./components/home/\";\r\n\r\nconst AppNavigator = StackNavigator(\r\n    {\r\n        Drawer: {screen: Drawer},\r\n       Home: { screen: Home },\r\n        Register: {screen: Register},\r\n    },\r\n    {\r\n        initialRouteName: \"Home\",\r\n           headerMode: Platform.OS == \"android\" ? \"none\" : \"float\",\r\n           headerBackTitle: Platform.OS == \"android\" ? \"none\" : \"Back\",\r\n        //header: (navigation) => ({\r\n            //left: (\r\n               // <Button\r\n              //    title=\"Back\"\r\n            //      onPress={ () => navigation.goBack() }  \r\n          //      />\r\n        //      )\r\n      //    })\r\n    }\r\n);\r\n\r\nexport default () =>\r\n    <Root>\r\n        <AppNavigator />\r\n    </Root>;\r\n```"}}
{"actor":{"display_login":"kelset"}}