{"action":"created","issue":{"url":"https://api.github.com/repos/react-navigation/react-navigation/issues/1213","repository_url":"https://api.github.com/repos/react-navigation/react-navigation","labels_url":"https://api.github.com/repos/react-navigation/react-navigation/issues/1213/labels{/name}","comments_url":"https://api.github.com/repos/react-navigation/react-navigation/issues/1213/comments","events_url":"https://api.github.com/repos/react-navigation/react-navigation/issues/1213/events","html_url":"https://github.com/react-navigation/react-navigation/issues/1213","id":223884040,"number":1213,"title":"How do I go back \"to\" an arbitrary route from another?","user":{"login":"joncursi","id":4974609,"avatar_url":"https://avatars3.githubusercontent.com/u/4974609?v=4","gravatar_id":"","url":"https://api.github.com/users/joncursi","html_url":"https://github.com/joncursi","followers_url":"https://api.github.com/users/joncursi/followers","following_url":"https://api.github.com/users/joncursi/following{/other_user}","gists_url":"https://api.github.com/users/joncursi/gists{/gist_id}","starred_url":"https://api.github.com/users/joncursi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joncursi/subscriptions","organizations_url":"https://api.github.com/users/joncursi/orgs","repos_url":"https://api.github.com/users/joncursi/repos","events_url":"https://api.github.com/users/joncursi/events{/privacy}","received_events_url":"https://api.github.com/users/joncursi/received_events","type":"User","site_admin":false},"labels":[{"id":526653633,"url":"https://api.github.com/repos/react-navigation/react-navigation/labels/question","name":"question","color":"cc317c","default":true},{"id":740353973,"url":"https://api.github.com/repos/react-navigation/react-navigation/labels/related:%20goBack","name":"related: goBack","color":"e8278a","default":false},{"id":562623782,"url":"https://api.github.com/repos/react-navigation/react-navigation/labels/request%20for%20comments","name":"request for comments","color":"bfd4f2","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":35,"created_at":"2017-04-24T16:51:48Z","updated_at":"2018-02-02T17:32:59Z","closed_at":"2018-02-01T20:00:05Z","author_association":"NONE","body":"I don't understand the meaning / usage of the `goBack` method when a key is supplied. Let's say I have the following event history:\r\n\r\n```js\r\nnavigation.navigate(SCREEN_KEY_A);\r\n...\r\nnavigation.navigate(SCREEN_KEY_B);\r\n...\r\nnavigation.navigate(SCREEN_KEY_C);\r\n...\r\nnavigation.navigate(SCREEN_KEY_D);\r\n```\r\n\r\nI am now on Screen D and when I click some contrived button on Screen D, I expect to go all the way back to A. Not immediately back to C, but straight back to A (popping D, C, and B). My intuition says the following code should do it:\r\n\r\n```jsx\r\nnavigation.goBack(SCREEN_KEY_A)\r\n```\r\n\r\nI.e., \"go back **TO** Screen A\", but this doesn't seem to be the case. [The docs say](https://github.com/react-community/react-navigation/blob/dff746a83c0159ebf69aeb9961228abe211e4041/docs/guides/Screen-Navigation-Prop.md#goback---close-the-active-screen-and-move-back) that when you supply a key to `goBack`, it specifies the screen to go back **FROM**. Does this mean in the example above, I would want:\r\n\r\n```js\r\nnavigation.goBack(SCREEN_KEY_B) // if I go back from B, I will land on A?\r\n```\r\n\r\nI tried the above usage (supplying a key to goBack), but nothing happens. Nothing gets popped, no errors are logged. So I've fallen back to using:\r\n\r\n```js\r\nnavigation.goBack(null);\r\nnavigation.goBack(null);\r\nnavigation.goBack(null);\r\n```\r\n\r\nBut this is terrible for obvious reasons.\r\n\r\nCan you clarify what you mean by \"from\", and how the `goBack` method should be used to achieve the example above? Thanks!"},"comment":{"url":"https://api.github.com/repos/react-navigation/react-navigation/issues/comments/362651575","html_url":"https://github.com/react-navigation/react-navigation/issues/1213#issuecomment-362651575","issue_url":"https://api.github.com/repos/react-navigation/react-navigation/issues/1213","id":362651575,"user":{"login":"ericvicenti","id":1483597,"avatar_url":"https://avatars1.githubusercontent.com/u/1483597?v=4","gravatar_id":"","url":"https://api.github.com/users/ericvicenti","html_url":"https://github.com/ericvicenti","followers_url":"https://api.github.com/users/ericvicenti/followers","following_url":"https://api.github.com/users/ericvicenti/following{/other_user}","gists_url":"https://api.github.com/users/ericvicenti/gists{/gist_id}","starred_url":"https://api.github.com/users/ericvicenti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericvicenti/subscriptions","organizations_url":"https://api.github.com/users/ericvicenti/orgs","repos_url":"https://api.github.com/users/ericvicenti/repos","events_url":"https://api.github.com/users/ericvicenti/events{/privacy}","received_events_url":"https://api.github.com/users/ericvicenti/received_events","type":"User","site_admin":false},"created_at":"2018-02-02T17:32:59Z","updated_at":"2018-02-02T17:32:59Z","author_association":"CONTRIBUTOR","body":"It seems there isn't a clear solution here, but thanks for the feedback. I'll keep the use case in mind for future improvements!"}}
{"actor":{"display_login":"ericvicenti"}}