{"action":"created","issue":{"url":"https://api.github.com/repos/ReactTraining/react-router/issues/4266","repository_url":"https://api.github.com/repos/ReactTraining/react-router","labels_url":"https://api.github.com/repos/ReactTraining/react-router/issues/4266/labels{/name}","comments_url":"https://api.github.com/repos/ReactTraining/react-router/issues/4266/comments","events_url":"https://api.github.com/repos/ReactTraining/react-router/issues/4266/events","html_url":"https://github.com/ReactTraining/react-router/issues/4266","id":194589045,"number":4266,"title":"Double call to Route.getComponent()","user":{"login":"BTMPL","id":247153,"avatar_url":"https://avatars.githubusercontent.com/u/247153?v=3","gravatar_id":"","url":"https://api.github.com/users/BTMPL","html_url":"https://github.com/BTMPL","followers_url":"https://api.github.com/users/BTMPL/followers","following_url":"https://api.github.com/users/BTMPL/following{/other_user}","gists_url":"https://api.github.com/users/BTMPL/gists{/gist_id}","starred_url":"https://api.github.com/users/BTMPL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BTMPL/subscriptions","organizations_url":"https://api.github.com/users/BTMPL/orgs","repos_url":"https://api.github.com/users/BTMPL/repos","events_url":"https://api.github.com/users/BTMPL/events{/privacy}","received_events_url":"https://api.github.com/users/BTMPL/received_events","type":"User","site_admin":false},"labels":[{"id":100166615,"url":"https://api.github.com/repos/ReactTraining/react-router/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/ReactTraining/react-router/milestones/14","html_url":"https://github.com/ReactTraining/react-router/milestone/14","labels_url":"https://api.github.com/repos/ReactTraining/react-router/milestones/14/labels","id":1707879,"number":14,"title":"v3.0.0","description":"","creator":{"login":"ryanflorence","id":100200,"avatar_url":"https://avatars.githubusercontent.com/u/100200?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanflorence","html_url":"https://github.com/ryanflorence","followers_url":"https://api.github.com/users/ryanflorence/followers","following_url":"https://api.github.com/users/ryanflorence/following{/other_user}","gists_url":"https://api.github.com/users/ryanflorence/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanflorence/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanflorence/subscriptions","organizations_url":"https://api.github.com/users/ryanflorence/orgs","repos_url":"https://api.github.com/users/ryanflorence/repos","events_url":"https://api.github.com/users/ryanflorence/events{/privacy}","received_events_url":"https://api.github.com/users/ryanflorence/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":17,"state":"open","created_at":"2016-04-14T22:57:44Z","updated_at":"2016-12-19T20:18:05Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-12-09T12:50:05Z","updated_at":"2016-12-27T15:18:19Z","closed_at":null,"body":"I'm trying to usee getComponent() to implement an loader pattern but the getComponent() is getting called twice for every request made to given route. Is this an expected behaviour (due to bubbling or some other re-rendeinrg of the tree) or is this a bug?\r\n\r\n## Version\r\n3.0.0\r\n\r\n## Test Case\r\nhttp://jsbin.com/patazecana/1/edit?html,js,console,output\r\n\r\n## Steps to reproduce\r\na) Run application\r\nb) Navigate to \"down\" link\r\n\r\n## Expected Behavior\r\na) on application load only one \"getComponent for /\" is shown in console\r\nb) on navigation only \"getComponent for /\" and \"getComponentFor /test\" are added to console\r\n\r\n## Actual Behavior\r\na) \"getComponent for /\" is shown twice\r\nb) both are shown twice"},"comment":{"url":"https://api.github.com/repos/ReactTraining/react-router/issues/comments/269339029","html_url":"https://github.com/ReactTraining/react-router/issues/4266#issuecomment-269339029","issue_url":"https://api.github.com/repos/ReactTraining/react-router/issues/4266","id":269339029,"user":{"login":"leofab86","id":16042447,"avatar_url":"https://avatars.githubusercontent.com/u/16042447?v=3","gravatar_id":"","url":"https://api.github.com/users/leofab86","html_url":"https://github.com/leofab86","followers_url":"https://api.github.com/users/leofab86/followers","following_url":"https://api.github.com/users/leofab86/following{/other_user}","gists_url":"https://api.github.com/users/leofab86/gists{/gist_id}","starred_url":"https://api.github.com/users/leofab86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leofab86/subscriptions","organizations_url":"https://api.github.com/users/leofab86/orgs","repos_url":"https://api.github.com/users/leofab86/repos","events_url":"https://api.github.com/users/leofab86/events{/privacy}","received_events_url":"https://api.github.com/users/leofab86/received_events","type":"User","site_admin":false},"created_at":"2016-12-27T15:18:19Z","updated_at":"2016-12-27T15:18:19Z","body":"I think this is the same issue I just asked about on stack. I stuck console logs in my component render functions and noticed that using Router Links renders each component twice. Heres the code that should reproduce this effect:\r\n\r\n```\r\nimport ReactDOM from 'react-dom';\r\nimport React from 'react';\r\nimport { Router, Route, Link, IndexRoute, hashHistory, browserHistory } from 'react-router';\r\n\r\n\r\nclass home extends React.Component {\r\n    render(){\r\n        console.log('RENDERING HOME');\r\n        return(\r\n            <Link to='destination'>Link to Destination</Link>\r\n        )\r\n    }\r\n}\r\n\r\nclass destination extends React.Component {\r\n    render(){\r\n        console.log('RENDERING DESTINATION');\r\n        return(\r\n            <Link to='/'>Link to Home</Link>\r\n        )\r\n    }\r\n}\r\n\r\nvar App = React.createClass({\r\n  render: function() {\r\n      return(\r\n          <Router history={hashHistory}>\r\n              <Route path='/' component={home}/>\r\n              <Route path='destination' component={destination}/>\r\n          </Router>\r\n      );\r\n  },\r\n});\r\n\r\n\r\nReactDOM.render(<App />, document.getElementById('app'));\r\n```"}}
{"actor":{"display_login":"leofab86"}}