{"action":"created","issue":{"url":"https://api.github.com/repos/rackt/react-router/issues/975","labels_url":"https://api.github.com/repos/rackt/react-router/issues/975/labels{/name}","comments_url":"https://api.github.com/repos/rackt/react-router/issues/975/comments","events_url":"https://api.github.com/repos/rackt/react-router/issues/975/events","html_url":"https://github.com/rackt/react-router/issues/975","id":63366694,"number":975,"title":"this.context.router is undefined","user":{"login":"tjwebb","id":1009114,"avatar_url":"https://avatars.githubusercontent.com/u/1009114?v=3","gravatar_id":"","url":"https://api.github.com/users/tjwebb","html_url":"https://github.com/tjwebb","followers_url":"https://api.github.com/users/tjwebb/followers","following_url":"https://api.github.com/users/tjwebb/following{/other_user}","gists_url":"https://api.github.com/users/tjwebb/gists{/gist_id}","starred_url":"https://api.github.com/users/tjwebb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjwebb/subscriptions","organizations_url":"https://api.github.com/users/tjwebb/orgs","repos_url":"https://api.github.com/users/tjwebb/repos","events_url":"https://api.github.com/users/tjwebb/events{/privacy}","received_events_url":"https://api.github.com/users/tjwebb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":63,"created_at":"2015-03-21T06:00:55Z","updated_at":"2015-10-09T11:34:44Z","closed_at":"2015-03-25T14:54:09Z","body":"I just upgraded to react-router (and react) 0.13, and got rid of all the deprecated State mixins. Using `this.context.router` doesn't seem to work. I just see this everywhere:\r\n\r\n```\r\nUncaught TypeError: Cannot read property 'getParams' of undefined\r\n```\r\nIs there anything additional I need to do?\r\n\r\n---\r\nEdit by Ryan Florence to get people to the answer right here at the top of the issue :dancer: \r\n\r\nCheck out the upgrade guide: https://github.com/rackt/react-router/blob/master/UPGRADE_GUIDE.md#012x---013x\r\n\r\nSorry it wasn't done w/ the release, it's been an abnormally busy month for us since we quit our jobs and started a new business :P"},"comment":{"url":"https://api.github.com/repos/rackt/react-router/issues/comments/146839762","html_url":"https://github.com/rackt/react-router/issues/975#issuecomment-146839762","issue_url":"https://api.github.com/repos/rackt/react-router/issues/975","id":146839762,"user":{"login":"stebru","id":24052,"avatar_url":"https://avatars.githubusercontent.com/u/24052?v=3","gravatar_id":"","url":"https://api.github.com/users/stebru","html_url":"https://github.com/stebru","followers_url":"https://api.github.com/users/stebru/followers","following_url":"https://api.github.com/users/stebru/following{/other_user}","gists_url":"https://api.github.com/users/stebru/gists{/gist_id}","starred_url":"https://api.github.com/users/stebru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stebru/subscriptions","organizations_url":"https://api.github.com/users/stebru/orgs","repos_url":"https://api.github.com/users/stebru/repos","events_url":"https://api.github.com/users/stebru/events{/privacy}","received_events_url":"https://api.github.com/users/stebru/received_events","type":"User","site_admin":false},"created_at":"2015-10-09T11:34:44Z","updated_at":"2015-10-09T11:34:44Z","body":"Still getting this error. I'm using:\r\n* react 0.13.3\r\n* react-router 1.0.0-rc3\r\n* browserify\r\n\r\n\r\n##### App.jsx:\r\n```javascript\r\n\r\nimport React from 'react';\r\nimport {Router, Route, Link, RouteHandler} from 'react-router';\r\nimport Transport from './Transport';\r\nimport LeftNav from 'material-ui/lib/left-nav';\r\n\r\nlet menuItems = [\r\n  { route: 'transport', text: 'Transport' },\r\n  { route: 'customization', text: 'Customization' },\r\n  { route: 'components', text: 'Components' },\r\n];\r\n\r\nclass AppLeftNav extends React.Component {\r\n\t_onLeftNavChange(e, key, payload) {\r\n\t\tconsole.log(this.context); // empty :(\r\n\t}\r\n\r\n\trender() {\r\n\t\tlet header = (<div>Header</div>);\r\n\t\treturn (\r\n\t\t\t<LeftNav ref='leftNav' docked={false} isInitiallyOpen={false} header={header} menuItems={menuItems} onChange={this._onLeftNavChange}/>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nclass AppRouter extends React.Component {\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t<Router ref=\"appRouter\" history={history}>\r\n\t\t\t\t<Route path='/' component={App}>\r\n\t\t\t\t\t<Route path='transport' component={Transport}/>\r\n\t\t\t\t</Route>\r\n\t\t\t</Router>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nclass App extends React.Component {\r\n (...)\r\n\r\n\tconstructor(props, context) {\r\n\t\tsuper(props, context);\r\n\t\tconsole.log('constructor', context); // empty :(\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tconsole.log(this.context); // empty :(\r\n\t}\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t<div>\r\n\t\t\t\t<AppLeftNav ref='appLeftNav' />\r\n\t  \t\t    (...)\r\n  \t\t    </div>\r\n\t\t);\r\n}\r\n\r\nApp.contextTypes = {\r\n\trouter: React.PropTypes.func.isRequired\r\n};\r\n\r\nexport default {App, AppRouter};\r\n```\r\n\r\n##### main.js:\r\n```javascript\r\nimport React from 'react';\r\nimport {AppRouter} from './components/App';\r\nimport injectTapEventPlugin from 'react-tap-event-plugin';\r\n\r\ninjectTapEventPlugin();\r\n\r\nReact.render((\r\n\tReact.createElement(AppRouter)\r\n), document.getElementById('app'));\r\n```\r\n\r\nBut ```this.context``` is always an empty object."}}