{"action":"opened","issue":{"url":"https://api.github.com/repos/cerebral/contribute/issues/2","repository_url":"https://api.github.com/repos/cerebral/contribute","labels_url":"https://api.github.com/repos/cerebral/contribute/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/cerebral/contribute/issues/2/comments","events_url":"https://api.github.com/repos/cerebral/contribute/issues/2/events","html_url":"https://github.com/cerebral/contribute/issues/2","id":176745780,"number":2,"title":"State props should override original props","user":{"login":"christianalfoni","id":3956929,"avatar_url":"https://avatars.githubusercontent.com/u/3956929?v=3","gravatar_id":"","url":"https://api.github.com/users/christianalfoni","html_url":"https://github.com/christianalfoni","followers_url":"https://api.github.com/users/christianalfoni/followers","following_url":"https://api.github.com/users/christianalfoni/following{/other_user}","gists_url":"https://api.github.com/users/christianalfoni/gists{/gist_id}","starred_url":"https://api.github.com/users/christianalfoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christianalfoni/subscriptions","organizations_url":"https://api.github.com/users/christianalfoni/orgs","repos_url":"https://api.github.com/users/christianalfoni/repos","events_url":"https://api.github.com/users/christianalfoni/events{/privacy}","received_events_url":"https://api.github.com/users/christianalfoni/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cerebral/contribute/labels/cerebral","name":"cerebral","color":"f27596"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/cerebral/contribute/milestones/2","html_url":"https://github.com/cerebral/contribute/milestones/Discussions","labels_url":"https://api.github.com/repos/cerebral/contribute/milestones/2/labels","id":2002381,"number":2,"title":"Discussions","description":"Issues in discussion","creator":{"login":"christianalfoni","id":3956929,"avatar_url":"https://avatars.githubusercontent.com/u/3956929?v=3","gravatar_id":"","url":"https://api.github.com/users/christianalfoni","html_url":"https://github.com/christianalfoni","followers_url":"https://api.github.com/users/christianalfoni/followers","following_url":"https://api.github.com/users/christianalfoni/following{/other_user}","gists_url":"https://api.github.com/users/christianalfoni/gists{/gist_id}","starred_url":"https://api.github.com/users/christianalfoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christianalfoni/subscriptions","organizations_url":"https://api.github.com/users/christianalfoni/orgs","repos_url":"https://api.github.com/users/christianalfoni/repos","events_url":"https://api.github.com/users/christianalfoni/events{/privacy}","received_events_url":"https://api.github.com/users/christianalfoni/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2016-09-13T20:18:51Z","updated_at":"2016-09-13T20:49:48Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2016-09-13T20:49:48Z","updated_at":"2016-09-13T20:49:48Z","closed_at":null,"body":"### Problem:\r\n\r\nGiven a component that accepts a prop x that then extracts state x, the explic state x is overridden by the original input prop.\r\n\r\n```js\r\n// given the following component where state value = 2:\r\nconst ComponentX = connect({ x: 'value' }, ({ x }) => <div>{x}</div>)\r\n\r\n// rendered with \r\n<ComponentX x={1} />\r\n```\r\n\r\nI would expect the output to be `<div>2</div>`, but it's `<div>1</div>`.\r\n\r\n### Reasoning:\r\n\r\nThe order is `props` => `state` => `render()` so I would expect state values to override props.\r\n\r\n### Justification:\r\n\r\nI have a case where I accept a prop then use a computed to verify and if necessary update the prop, but this is always overridden by the original prop value even though the computed function is executed.\r\n\r\n"}}
{"actor":{"display_login":"christianalfoni"}}