{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/react-native/pulls/comments/59846295","id":59846295,"diff_hunk":"@@ -1051,17 +1035,40 @@ var Navigator = React.createClass({\n     this.pop();\n   },\n \n-  /**\n-   * Navigate to a new scene and reset route stack.\n-   */\n-  resetTo: function(route) {\n+  _push: function(route, transition_cb) {\n     invariant(!!route, 'Must supply route to push');\n-    this.replaceAtIndex(route, 0, () => {\n-      // Do not use popToRoute here, because race conditions could prevent the\n-      // route from existing at this time. Instead, just go to index 0\n-      if (this.state.presentedIndex > 0) {\n-        this._popN(this.state.presentedIndex);\n-      }\n+    var activeLength = this.state.presentedIndex + 1;\n+    var activeStack = this.state.routeStack.slice(0, activeLength);\n+    var activeAnimationConfigStack = this.state.sceneConfigStack.slice(0, activeLength);\n+    var nextStack = activeStack.concat([route]);\n+    var destIndex = nextStack.length - 1;\n+    var nextAnimationConfigStack = activeAnimationConfigStack.concat([\n+      this.props.configureScene(route, nextStack),\n+    ]);\n+    this._emitWillFocus(nextStack[destIndex]);\n+    this.setState({\n+      routeStack: nextStack,\n+      sceneConfigStack: nextAnimationConfigStack,\n+    }, () => {\n+      this._enableScene(destIndex);\n+      this._transitionTo(destIndex, null, null, transition_cb);\n+    });\n+  },\n+\n+  resetTo: function(route) {\n+    // Push a new route and reset routestack inside transition callback\n+    this._push(route, () => {\n+      var nextStack = this.state.routeStack.slice(-1);\n+      this.setState({","path":"Libraries/CustomComponents/Navigator/Navigator.js","position":63,"original_position":63,"commit_id":"de40e514013c3d844b22e7434c07a9fa95e42eca","original_commit_id":"de40e514013c3d844b22e7434c07a9fa95e42eca","user":{"login":"eslint-bot","id":16061708,"avatar_url":"https://avatars.githubusercontent.com/u/16061708?v=3","gravatar_id":"","url":"https://api.github.com/users/eslint-bot","html_url":"https://github.com/eslint-bot","followers_url":"https://api.github.com/users/eslint-bot/followers","following_url":"https://api.github.com/users/eslint-bot/following{/other_user}","gists_url":"https://api.github.com/users/eslint-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/eslint-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eslint-bot/subscriptions","organizations_url":"https://api.github.com/users/eslint-bot/orgs","repos_url":"https://api.github.com/users/eslint-bot/repos","events_url":"https://api.github.com/users/eslint-bot/events{/privacy}","received_events_url":"https://api.github.com/users/eslint-bot/received_events","type":"User","site_admin":false},"body":"no-shadow: 'route' is already declared in the upper scope.","created_at":"2016-04-15T09:04:48Z","updated_at":"2016-04-15T09:04:48Z","html_url":"https://github.com/facebook/react-native/pull/6231#discussion_r59846295","pull_request_url":"https://api.github.com/repos/facebook/react-native/pulls/6231","_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/comments/59846295"},"html":{"href":"https://github.com/facebook/react-native/pull/6231#discussion_r59846295"},"pull_request":{"href":"https://api.github.com/repos/facebook/react-native/pulls/6231"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/6231","id":61280075,"html_url":"https://github.com/facebook/react-native/pull/6231","diff_url":"https://github.com/facebook/react-native/pull/6231.diff","patch_url":"https://github.com/facebook/react-native/pull/6231.patch","issue_url":"https://api.github.com/repos/facebook/react-native/issues/6231","number":6231,"state":"open","locked":false,"title":"Navigator:Add animation to resetTo method","user":{"login":"CntChen","id":4598445,"avatar_url":"https://avatars.githubusercontent.com/u/4598445?v=3","gravatar_id":"","url":"https://api.github.com/users/CntChen","html_url":"https://github.com/CntChen","followers_url":"https://api.github.com/users/CntChen/followers","following_url":"https://api.github.com/users/CntChen/following{/other_user}","gists_url":"https://api.github.com/users/CntChen/gists{/gist_id}","starred_url":"https://api.github.com/users/CntChen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CntChen/subscriptions","organizations_url":"https://api.github.com/users/CntChen/orgs","repos_url":"https://api.github.com/users/CntChen/repos","events_url":"https://api.github.com/users/CntChen/events{/privacy}","received_events_url":"https://api.github.com/users/CntChen/received_events","type":"User","site_admin":false},"body":"The previous `resetTo` method has inconsistent transition animation.\r\nWhen route stack only contain one route, `resetTo(newRoute)` will immediately render new scene without animation, otherwise has scene transition animation (by using `_popN`);\r\n\r\nI think `resetTo` method better have animation to provide consistent user experience. Transition without animation can use `immediatelyResetRouteStack` or `replace`.\r\n\r\nRelated topic:[`PR#1300`](https://github.com/facebook/react-native/pull/1300)\r\n@ericvicenti @pwmckenna","created_at":"2016-03-01T17:44:41Z","updated_at":"2016-04-15T09:04:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ea4dd50d8c85ef553a292f4ed0b76f2138ed725","assignee":{"login":"ericvicenti","id":1483597,"avatar_url":"https://avatars.githubusercontent.com/u/1483597?v=3","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},"milestone":null,"commits_url":"https://api.github.com/repos/facebook/react-native/pulls/6231/commits","review_comments_url":"https://api.github.com/repos/facebook/react-native/pulls/6231/comments","review_comment_url":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/6231/comments","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/de40e514013c3d844b22e7434c07a9fa95e42eca","head":{"label":"CntChen:master","ref":"master","sha":"de40e514013c3d844b22e7434c07a9fa95e42eca","user":{"login":"CntChen","id":4598445,"avatar_url":"https://avatars.githubusercontent.com/u/4598445?v=3","gravatar_id":"","url":"https://api.github.com/users/CntChen","html_url":"https://github.com/CntChen","followers_url":"https://api.github.com/users/CntChen/followers","following_url":"https://api.github.com/users/CntChen/following{/other_user}","gists_url":"https://api.github.com/users/CntChen/gists{/gist_id}","starred_url":"https://api.github.com/users/CntChen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CntChen/subscriptions","organizations_url":"https://api.github.com/users/CntChen/orgs","repos_url":"https://api.github.com/users/CntChen/repos","events_url":"https://api.github.com/users/CntChen/events{/privacy}","received_events_url":"https://api.github.com/users/CntChen/received_events","type":"User","site_admin":false},"repo":{"id":52891882,"name":"react-native","full_name":"CntChen/react-native","owner":{"login":"CntChen","id":4598445,"avatar_url":"https://avatars.githubusercontent.com/u/4598445?v=3","gravatar_id":"","url":"https://api.github.com/users/CntChen","html_url":"https://github.com/CntChen","followers_url":"https://api.github.com/users/CntChen/followers","following_url":"https://api.github.com/users/CntChen/following{/other_user}","gists_url":"https://api.github.com/users/CntChen/gists{/gist_id}","starred_url":"https://api.github.com/users/CntChen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CntChen/subscriptions","organizations_url":"https://api.github.com/users/CntChen/orgs","repos_url":"https://api.github.com/users/CntChen/repos","events_url":"https://api.github.com/users/CntChen/events{/privacy}","received_events_url":"https://api.github.com/users/CntChen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CntChen/react-native","description":"A framework for building native apps with React.","fork":true,"url":"https://api.github.com/repos/CntChen/react-native","forks_url":"https://api.github.com/repos/CntChen/react-native/forks","keys_url":"https://api.github.com/repos/CntChen/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CntChen/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CntChen/react-native/teams","hooks_url":"https://api.github.com/repos/CntChen/react-native/hooks","issue_events_url":"https://api.github.com/repos/CntChen/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/CntChen/react-native/events","assignees_url":"https://api.github.com/repos/CntChen/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/CntChen/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/CntChen/react-native/tags","blobs_url":"https://api.github.com/repos/CntChen/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CntChen/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CntChen/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/CntChen/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CntChen/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/CntChen/react-native/languages","stargazers_url":"https://api.github.com/repos/CntChen/react-native/stargazers","contributors_url":"https://api.github.com/repos/CntChen/react-native/contributors","subscribers_url":"https://api.github.com/repos/CntChen/react-native/subscribers","subscription_url":"https://api.github.com/repos/CntChen/react-native/subscription","commits_url":"https://api.github.com/repos/CntChen/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/CntChen/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/CntChen/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/CntChen/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/CntChen/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/CntChen/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CntChen/react-native/merges","archive_url":"https://api.github.com/repos/CntChen/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CntChen/react-native/downloads","issues_url":"https://api.github.com/repos/CntChen/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/CntChen/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/CntChen/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/CntChen/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CntChen/react-native/labels{/name}","releases_url":"https://api.github.com/repos/CntChen/react-native/releases{/id}","deployments_url":"https://api.github.com/repos/CntChen/react-native/deployments","created_at":"2016-03-01T16:27:25Z","updated_at":"2016-03-14T01:12:58Z","pushed_at":"2016-04-15T08:55:28Z","git_url":"git://github.com/CntChen/react-native.git","ssh_url":"git@github.com:CntChen/react-native.git","clone_url":"https://github.com/CntChen/react-native.git","svn_url":"https://github.com/CntChen/react-native","homepage":"http://facebook.github.io/react-native/","size":49791,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"719c9aa6fed5d8c24b51a966b36a28ec10f28cc5","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":29028775,"name":"react-native","full_name":"facebook/react-native","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/react-native","description":"A framework for building native apps with React.","fork":false,"url":"https://api.github.com/repos/facebook/react-native","forks_url":"https://api.github.com/repos/facebook/react-native/forks","keys_url":"https://api.github.com/repos/facebook/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/react-native/teams","hooks_url":"https://api.github.com/repos/facebook/react-native/hooks","issue_events_url":"https://api.github.com/repos/facebook/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/react-native/events","assignees_url":"https://api.github.com/repos/facebook/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/react-native/tags","blobs_url":"https://api.github.com/repos/facebook/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/react-native/languages","stargazers_url":"https://api.github.com/repos/facebook/react-native/stargazers","contributors_url":"https://api.github.com/repos/facebook/react-native/contributors","subscribers_url":"https://api.github.com/repos/facebook/react-native/subscribers","subscription_url":"https://api.github.com/repos/facebook/react-native/subscription","commits_url":"https://api.github.com/repos/facebook/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/react-native/merges","archive_url":"https://api.github.com/repos/facebook/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/react-native/downloads","issues_url":"https://api.github.com/repos/facebook/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/react-native/labels{/name}","releases_url":"https://api.github.com/repos/facebook/react-native/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/react-native/deployments","created_at":"2015-01-09T18:10:16Z","updated_at":"2016-04-15T09:00:59Z","pushed_at":"2016-04-15T08:55:32Z","git_url":"git://github.com/facebook/react-native.git","ssh_url":"git@github.com:facebook/react-native.git","clone_url":"https://github.com/facebook/react-native.git","svn_url":"https://github.com/facebook/react-native","homepage":"http://facebook.github.io/react-native/","size":88962,"stargazers_count":30545,"watchers_count":30545,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5965,"mirror_url":null,"open_issues_count":665,"forks":5965,"open_issues":665,"watchers":30545,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/6231"},"html":{"href":"https://github.com/facebook/react-native/pull/6231"},"issue":{"href":"https://api.github.com/repos/facebook/react-native/issues/6231"},"comments":{"href":"https://api.github.com/repos/facebook/react-native/issues/6231/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/react-native/pulls/6231/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/react-native/pulls/6231/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/react-native/statuses/de40e514013c3d844b22e7434c07a9fa95e42eca"}}}}