{"action":"closed","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/17241","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/17241/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/17241/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/17241/events","html_url":"https://github.com/facebook/react-native/issues/17241","id":282631818,"number":17241,"title":"Back Handler: repeating one screens functionality in other screen","user":{"login":"vigneshwarrao","id":10556489,"avatar_url":"https://avatars0.githubusercontent.com/u/10556489?v=4","gravatar_id":"","url":"https://api.github.com/users/vigneshwarrao","html_url":"https://github.com/vigneshwarrao","followers_url":"https://api.github.com/users/vigneshwarrao/followers","following_url":"https://api.github.com/users/vigneshwarrao/following{/other_user}","gists_url":"https://api.github.com/users/vigneshwarrao/gists{/gist_id}","starred_url":"https://api.github.com/users/vigneshwarrao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vigneshwarrao/subscriptions","organizations_url":"https://api.github.com/users/vigneshwarrao/orgs","repos_url":"https://api.github.com/users/vigneshwarrao/repos","events_url":"https://api.github.com/users/vigneshwarrao/events{/privacy}","received_events_url":"https://api.github.com/users/vigneshwarrao/received_events","type":"User","site_admin":false},"labels":[{"id":718241807,"url":"https://api.github.com/repos/facebook/react-native/labels/Stale","name":"Stale","color":"e99695","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-12-16T15:54:30Z","updated_at":"2018-04-23T06:44:56Z","closed_at":"2018-04-23T06:44:56Z","author_association":"NONE","body":"<!--\r\n  PLEASE DON'T DELETE THIS TEMPLATE UNTIL YOU HAVE READ THE FIRST SECTION.\r\n-->\r\n\r\n### Is this a bug report?\r\n\r\nI hope it is bug, if my functionality is fine.\r\n\r\n<!--\r\n  If you answered \"Yes\":\r\n\r\n    We expect that it will take you about 30 minutes to produce a high-quality bug report.\r\n    While this may seem like a lot, putting care into issues helps us fix them faster.\r\n    For bug reports, it is REQUIRED to fill the rest of this template, or the issue will be closed.\r\n\r\n  If you answered \"No\":\r\n\r\n    We use GitHub Issues exclusively for tracking bugs in React Native. If you're looking for help,\r\n    the Community page at http://facebook.github.io/react-native/help.html list various resources \r\n    that should help you get started.\r\n\r\n  Now scroll below!\r\n-->\r\n\r\n### Have you read the [Contributing Guidelines](https://facebook.github.io/react-native/docs/contributing.html)?\r\n\r\nYes\r\n\r\n### Environment\r\n\r\n<!--\r\n  In your terminal run `react-native info` and paste its contents here. Next, specify your target platform, like this:\r\n\r\n  Environment:\r\n    OS:  macOS Sierra 10.12.6\r\n    Node:  8.4.0\r\n    Yarn:  0.27.5\r\n    npm:  5.4.0\r\n    Watchman:  4.7.0\r\n    Xcode:  Xcode 8.3.3 Build version 8E3004b\r\n    Android Studio:  2.3 AI-162.4069837\r\n\r\n  Packages: (wanted => installed)\r\n    react-native: 0.48.1 => 0.48.1\r\n    react: 16.0.0-alpha.12 => 16.0.0-alpha.12\r\n\r\n  Target Platform: iOS (10.3)\r\n\r\n  ***Make sure you are on v0.48.0 or greater of react-native, otherwise you may get this error:\r\n\r\n  Unrecognized command 'info'\r\n  Run react-native --help to see list of all available commands\r\n-->\r\n\r\n### Steps to Reproduce\r\n\r\n<!--\r\n  How would you describe your issue to someone who doesn’t know you or your project?\r\n  Try to write a sequence of steps that anybody can repeat to see the issue.\r\n  Be specific! If the bug cannot be reproduced, your issue may be closed.\r\n-->\r\n\r\n(Write your steps here:)\r\n\r\n1. We have implemented back handler in our app.\r\n2. Suppose two screens from all screens, Products list and Selected Product Description.\r\n3. In product list we placed sign out confirmation on clicking of back handler, where as in Product description we just kept back handler disabled.\r\n4. So, we are getting sign out confirmation even on the Product description screen, where it should only restrict going back.\r\nThe code we used is:\r\n\r\ncomponentDidMount() {\r\n        const nav = this.props.navigation;\r\n        BackHandler.addEventListener('hardwareBackPress', function () {\r\n            this.setState({logoutModalBool:true});\r\n            return true;\r\n        });\r\n    }\r\n    componentWillUnmount(){\r\n        BackHandler.removeEventListener('hardwareBackPress', function(){\r\n            self.setState({logoutModalBool:false});\r\n            return true;\r\n        });\r\n    }\r\n\r\n### Expected Behavior\r\nIt should be not show popup confirmation in Product description because it is already removed in componentWillUnmount.\r\n"}}
{"actor":{"display_login":"stale"}}