{"action":"created","issue":{"url":"https://api.github.com/repos/react-community/react-navigation/issues/684","repository_url":"https://api.github.com/repos/react-community/react-navigation","labels_url":"https://api.github.com/repos/react-community/react-navigation/issues/684/labels{/name}","comments_url":"https://api.github.com/repos/react-community/react-navigation/issues/684/comments","events_url":"https://api.github.com/repos/react-community/react-navigation/issues/684/events","html_url":"https://github.com/react-community/react-navigation/issues/684","id":214110015,"number":684,"title":"goBack detect stackNavigator","user":{"login":"quangas","id":16985574,"avatar_url":"https://avatars2.githubusercontent.com/u/16985574?v=3","gravatar_id":"","url":"https://api.github.com/users/quangas","html_url":"https://github.com/quangas","followers_url":"https://api.github.com/users/quangas/followers","following_url":"https://api.github.com/users/quangas/following{/other_user}","gists_url":"https://api.github.com/users/quangas/gists{/gist_id}","starred_url":"https://api.github.com/users/quangas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quangas/subscriptions","organizations_url":"https://api.github.com/users/quangas/orgs","repos_url":"https://api.github.com/users/quangas/repos","events_url":"https://api.github.com/users/quangas/events{/privacy}","received_events_url":"https://api.github.com/users/quangas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-03-14T15:29:09Z","updated_at":"2017-03-22T03:03:07Z","closed_at":null,"body":"Screen A -> Screen B\r\n\r\nOn Screen B after I fill in a form, I use goBack() to go back to Screen A. However upon going back to Screen A, I need to refresh its contents. From Screen A, how can I detect a 'goBack()' event?\r\n\r\nIs there any other way to solve this? \r\n\r\nFrom Screen B i could do navigate('ScreenA') but then I have an extra Screen on the stack so it will look like Screen A -> Screen B -> Screen A. Is there maybe a way to pop Screen A when I go to Screen B? If so, how?\r\n"},"comment":{"url":"https://api.github.com/repos/react-community/react-navigation/issues/comments/288284875","html_url":"https://github.com/react-community/react-navigation/issues/684#issuecomment-288284875","issue_url":"https://api.github.com/repos/react-community/react-navigation/issues/684","id":288284875,"user":{"login":"JimmyDaddy","id":16460813,"avatar_url":"https://avatars1.githubusercontent.com/u/16460813?v=3","gravatar_id":"","url":"https://api.github.com/users/JimmyDaddy","html_url":"https://github.com/JimmyDaddy","followers_url":"https://api.github.com/users/JimmyDaddy/followers","following_url":"https://api.github.com/users/JimmyDaddy/following{/other_user}","gists_url":"https://api.github.com/users/JimmyDaddy/gists{/gist_id}","starred_url":"https://api.github.com/users/JimmyDaddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JimmyDaddy/subscriptions","organizations_url":"https://api.github.com/users/JimmyDaddy/orgs","repos_url":"https://api.github.com/users/JimmyDaddy/repos","events_url":"https://api.github.com/users/JimmyDaddy/events{/privacy}","received_events_url":"https://api.github.com/users/JimmyDaddy/received_events","type":"User","site_admin":false},"created_at":"2017-03-22T03:03:07Z","updated_at":"2017-03-22T03:03:07Z","body":"@quangas you can pass a refresh function to B, and before close B action you can run the refresh function, then goBack A\r\n\r\n```\r\n//ScreenA...\r\ngoBAction = () => {\r\n   const {navigation} = this.props;\r\n   navigation.navigate('B', {refresh: refreshFunction});\r\n}\r\nrefreshFunction = () => {\r\n   //do refresh\r\n}\r\n\r\n//ScreenB...\r\ngoBackAAction = () => {\r\n    const {navigation} = this.props;\r\n    const {state} = navigation;\r\n    let refreshFunc = state.refresh;\r\nif(typeof refreshFunc === 'function'){\r\n    refreshFunc();\r\n}\r\n   navigation.goBack();\r\n}\r\n\r\n```\r\n\r\n  "}}
{"actor":{"display_login":"JimmyDaddy"}}