{"action":"opened","issue":{"url":"https://api.github.com/repos/ReactTraining/react-router/issues/5951","repository_url":"https://api.github.com/repos/ReactTraining/react-router","labels_url":"https://api.github.com/repos/ReactTraining/react-router/issues/5951/labels{/name}","comments_url":"https://api.github.com/repos/ReactTraining/react-router/issues/5951/comments","events_url":"https://api.github.com/repos/ReactTraining/react-router/issues/5951/events","html_url":"https://github.com/ReactTraining/react-router/issues/5951","id":297914823,"number":5951,"title":"props.match.params not consistent with URL in ShouldComponentUpdate() after <Link> click","user":{"login":"emcelyea","id":28745743,"avatar_url":"https://avatars3.githubusercontent.com/u/28745743?v=4","gravatar_id":"","url":"https://api.github.com/users/emcelyea","html_url":"https://github.com/emcelyea","followers_url":"https://api.github.com/users/emcelyea/followers","following_url":"https://api.github.com/users/emcelyea/following{/other_user}","gists_url":"https://api.github.com/users/emcelyea/gists{/gist_id}","starred_url":"https://api.github.com/users/emcelyea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emcelyea/subscriptions","organizations_url":"https://api.github.com/users/emcelyea/orgs","repos_url":"https://api.github.com/users/emcelyea/repos","events_url":"https://api.github.com/users/emcelyea/events{/privacy}","received_events_url":"https://api.github.com/users/emcelyea/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-16T20:46:12Z","updated_at":"2018-02-16T20:46:12Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nThank you for contributing!\r\n\r\nHave a usage question?\r\n======================\r\nThe issue tracker is meant for bug reports only. This isn't the best place for usage questions. Questions here don't have as much visibility as they do elsewhere. Before you ask a question, here are some resources to get help first:\r\n\r\n- Read the docs: https://reacttraining.com/react-router\r\n- Check out the list of frequently asked questions: https://github.com/ReactTraining/react-router/blob/master/FAQ.md\r\n- Explore examples: https://reacttraining.com/react-router/web/example/basic\r\n- Look for/ask questions on Stack Overflow: https://stackoverflow.com/questions/ask?tags=react-router\r\n- Ask in chat: https://discord.gg/0ZcbPKXt5bYaNQ46\r\n\r\nThink you found a bug?\r\n======================\r\nThe best bug report is a failing test in the repository as a pull request. Otherwise, please use the \"BUG REPORT\" template below.\r\n\r\nHave a feature request?\r\n=======================\r\nRemove the template from below and provide thoughtful commentary *and code samples* on what this feature means for your product. What will it allow you to do that you can't do today? How will it make current work-arounds straightforward? What potential bugs and edge cases does it help to avoid? etc. Please keep it product-centric.\r\n-->\r\n\r\n<!-- BUG TEMPLATE -->\r\n## Version\r\n4.1.1\r\n\r\n## Test Case\r\nhttps://codesandbox.io/s/n55VljYk7\r\n\r\n## Steps to reproduce\r\n* Url path should be something like path=\"/item/:id\" where :id is a unique identifier.\r\n* Click a <Link> with a to=\"/item/1\"\r\n* Click a <Link> with a to=\"/item/2\", no other props/state changes should happen but this :id change\r\n* Watch for :id changes in ShouldComponentUpdate() (the last place you can safely setState())\r\n* this.props.params.match.id !== :id in the url, in the render() function the value has been updated, but in shouldComponentUpdate() the props have not been updated yet. See screenshot:\r\n![screen shot 2018-02-16 at 12 23 56 pm](https://user-images.githubusercontent.com/28745743/36327797-93c0255c-1314-11e8-95fe-d2e0fe85783c.png)\r\n\r\n## Expected Behavior\r\nshouldComponentUpdate() will receive this.props.match.params that are consistent with URL\r\n\r\n## Actual Behavior\r\nshouldComponentUpdate() contains params from the previous URL."}}
{"actor":{"display_login":"emcelyea"}}