{"action":"created","issue":{"url":"https://api.github.com/repos/reactjs/react-router/issues/3540","repository_url":"https://api.github.com/repos/reactjs/react-router","labels_url":"https://api.github.com/repos/reactjs/react-router/issues/3540/labels{/name}","comments_url":"https://api.github.com/repos/reactjs/react-router/issues/3540/comments","events_url":"https://api.github.com/repos/reactjs/react-router/issues/3540/events","html_url":"https://github.com/reactjs/react-router/issues/3540","id":160272534,"number":3540,"title":"documentation inaccurate for props.location","user":{"login":"brennancheung","id":289156,"avatar_url":"https://avatars.githubusercontent.com/u/289156?v=3","gravatar_id":"","url":"https://api.github.com/users/brennancheung","html_url":"https://github.com/brennancheung","followers_url":"https://api.github.com/users/brennancheung/followers","following_url":"https://api.github.com/users/brennancheung/following{/other_user}","gists_url":"https://api.github.com/users/brennancheung/gists{/gist_id}","starred_url":"https://api.github.com/users/brennancheung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brennancheung/subscriptions","organizations_url":"https://api.github.com/users/brennancheung/orgs","repos_url":"https://api.github.com/users/brennancheung/repos","events_url":"https://api.github.com/users/brennancheung/events{/privacy}","received_events_url":"https://api.github.com/users/brennancheung/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-06-14T20:11:01Z","updated_at":"2016-06-14T21:51:11Z","closed_at":"2016-06-14T21:09:53Z","body":"According to the documentation if I want to access `props.location` it tells me I should add it to the context.\r\n\r\n> Access location from this.props.location of your Route component. If you'd like to get it deeper in the tree, you can use whatever conventions your app has for getting props from high down low. One option is to provide it on context yourself\r\n\r\nWhen I do this it tells me:\r\n\r\n> `context.location` is deprecated, please use a route component's `props.location` instead. http://tiny.cc/router-accessinglocation\r\n\r\n\r\n\r\nBut it doesn't have `props.location`.  Which is the whole reason I added it to the context.\r\n\r\nI tried adding `withRouter` because the documentation states:\r\n\r\n> NOTE: v2.4.0 and higher include a higher-order component `withRouter` that is now the (highly) recommended way of accessing the router object.\r\n\r\nBut I don't see any way to get access to `location` from the router object and `withRouter` doesn't add `props.location` to the wrapped component.\r\n\r\nWhat is the recommended approach to accessing `location` when not a top level route component?  This should be documented."},"comment":{"url":"https://api.github.com/repos/reactjs/react-router/issues/comments/226027161","html_url":"https://github.com/reactjs/react-router/issues/3540#issuecomment-226027161","issue_url":"https://api.github.com/repos/reactjs/react-router/issues/3540","id":226027161,"user":{"login":"taion","id":3112159,"avatar_url":"https://avatars.githubusercontent.com/u/3112159?v=3","gravatar_id":"","url":"https://api.github.com/users/taion","html_url":"https://github.com/taion","followers_url":"https://api.github.com/users/taion/followers","following_url":"https://api.github.com/users/taion/following{/other_user}","gists_url":"https://api.github.com/users/taion/gists{/gist_id}","starred_url":"https://api.github.com/users/taion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taion/subscriptions","organizations_url":"https://api.github.com/users/taion/orgs","repos_url":"https://api.github.com/users/taion/repos","events_url":"https://api.github.com/users/taion/events{/privacy}","received_events_url":"https://api.github.com/users/taion/received_events","type":"User","site_admin":false},"created_at":"2016-06-14T21:51:11Z","updated_at":"2016-06-14T21:51:11Z","body":"You are not correctly exporting `location` on `context`, then. That deprecation warning only shows up if you're somehow hitting the deprecated export of context."}}
{"actor":{"display_login":"taion"}}