{"action":"opened","number":514,"pull_request":{"url":"https://api.github.com/repos/alfa-laboratory/arui-feather/pulls/514","id":168567605,"html_url":"https://github.com/alfa-laboratory/arui-feather/pull/514","diff_url":"https://github.com/alfa-laboratory/arui-feather/pull/514.diff","patch_url":"https://github.com/alfa-laboratory/arui-feather/pull/514.patch","issue_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/issues/514","number":514,"state":"open","locked":false,"title":"feat(input): no need to set state if input value is controlled by input","user":{"login":"astandrik","id":8037318,"avatar_url":"https://avatars3.githubusercontent.com/u/8037318?v=4","gravatar_id":"","url":"https://api.github.com/users/astandrik","html_url":"https://github.com/astandrik","followers_url":"https://api.github.com/users/astandrik/followers","following_url":"https://api.github.com/users/astandrik/following{/other_user}","gists_url":"https://api.github.com/users/astandrik/gists{/gist_id}","starred_url":"https://api.github.com/users/astandrik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astandrik/subscriptions","organizations_url":"https://api.github.com/users/astandrik/orgs","repos_url":"https://api.github.com/users/astandrik/repos","events_url":"https://api.github.com/users/astandrik/events{/privacy}","received_events_url":"https://api.github.com/users/astandrik/received_events","type":"User","site_admin":false},"body":"Убрал выставление value в стейт для случая, если value передаётся с пропсами. Зачем надо? Об этом далее.\r\n\r\n\r\nВ рендере если инпут привязан к валью в пропсах, то он игнорирует значение в стейте. \r\n\r\nПри этом если мы делаем setState, в пропсы ещё не обновились, то у нас берётся предыдущее значение value из пропсов\r\n        let value = this.props.value !== undefined\r\n            ? this.props.value\r\n            : this.state.value;\r\n\r\n и апдейтится value инпута на старое значение. \r\n\r\nПотом апдейтятся пропсы и компонент снова перерисовывается уже с новым значением, и каретка улетает в конец инпута.\r\n\r\n\r\nПорочный воркфлоу такой:\r\nПоехал changeValue -> setState -> (тут же рендер с предыдущим props.value) -> dispatch new props -> (снова рендер, но уже с новыми props.value)","created_at":"2018-02-12T12:34:30Z","updated_at":"2018-02-12T12:34:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/pulls/514/commits","review_comments_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/pulls/514/comments","review_comment_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/issues/514/comments","statuses_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/statuses/d7141008f083981eecae84e25c935fe52ecdf92d","head":{"label":"alfa-laboratory:feat/input-stateless-component","ref":"feat/input-stateless-component","sha":"d7141008f083981eecae84e25c935fe52ecdf92d","user":{"login":"alfa-laboratory","id":20887020,"avatar_url":"https://avatars1.githubusercontent.com/u/20887020?v=4","gravatar_id":"","url":"https://api.github.com/users/alfa-laboratory","html_url":"https://github.com/alfa-laboratory","followers_url":"https://api.github.com/users/alfa-laboratory/followers","following_url":"https://api.github.com/users/alfa-laboratory/following{/other_user}","gists_url":"https://api.github.com/users/alfa-laboratory/gists{/gist_id}","starred_url":"https://api.github.com/users/alfa-laboratory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alfa-laboratory/subscriptions","organizations_url":"https://api.github.com/users/alfa-laboratory/orgs","repos_url":"https://api.github.com/users/alfa-laboratory/repos","events_url":"https://api.github.com/users/alfa-laboratory/events{/privacy}","received_events_url":"https://api.github.com/users/alfa-laboratory/received_events","type":"Organization","site_admin":false},"repo":{"id":87942363,"name":"arui-feather","full_name":"alfa-laboratory/arui-feather","owner":{"login":"alfa-laboratory","id":20887020,"avatar_url":"https://avatars1.githubusercontent.com/u/20887020?v=4","gravatar_id":"","url":"https://api.github.com/users/alfa-laboratory","html_url":"https://github.com/alfa-laboratory","followers_url":"https://api.github.com/users/alfa-laboratory/followers","following_url":"https://api.github.com/users/alfa-laboratory/following{/other_user}","gists_url":"https://api.github.com/users/alfa-laboratory/gists{/gist_id}","starred_url":"https://api.github.com/users/alfa-laboratory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alfa-laboratory/subscriptions","organizations_url":"https://api.github.com/users/alfa-laboratory/orgs","repos_url":"https://api.github.com/users/alfa-laboratory/repos","events_url":"https://api.github.com/users/alfa-laboratory/events{/privacy}","received_events_url":"https://api.github.com/users/alfa-laboratory/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alfa-laboratory/arui-feather","description":"Alfa-Bank UI library","fork":false,"url":"https://api.github.com/repos/alfa-laboratory/arui-feather","forks_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/forks","keys_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/teams","hooks_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/hooks","issue_events_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/issues/events{/number}","events_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/events","assignees_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/assignees{/user}","branches_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/branches{/branch}","tags_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/tags","blobs_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/git/refs{/sha}","trees_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/statuses/{sha}","languages_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/languages","stargazers_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/stargazers","contributors_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/contributors","subscribers_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/subscribers","subscription_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/subscription","commits_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/commits{/sha}","git_commits_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/git/commits{/sha}","comments_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/comments{/number}","issue_comment_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/issues/comments{/number}","contents_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/contents/{+path}","compare_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/merges","archive_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/downloads","issues_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/issues{/number}","pulls_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/pulls{/number}","milestones_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/milestones{/number}","notifications_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/labels{/name}","releases_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/releases{/id}","deployments_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/deployments","created_at":"2017-04-11T14:14:05Z","updated_at":"2018-02-05T12:30:33Z","pushed_at":"2018-02-12T12:31:58Z","git_url":"git://github.com/alfa-laboratory/arui-feather.git","ssh_url":"git@github.com:alfa-laboratory/arui-feather.git","clone_url":"https://github.com/alfa-laboratory/arui-feather.git","svn_url":"https://github.com/alfa-laboratory/arui-feather","homepage":"https://alfa-laboratory.github.io/arui-feather/styleguide/","size":69738,"stargazers_count":233,"watchers_count":233,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":42,"mirror_url":null,"archived":false,"open_issues_count":18,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":42,"open_issues":18,"watchers":233,"default_branch":"master"}},"base":{"label":"alfa-laboratory:master","ref":"master","sha":"efcc2aa86101497a5ada235bd5506de041eff2ff","user":{"login":"alfa-laboratory","id":20887020,"avatar_url":"https://avatars1.githubusercontent.com/u/20887020?v=4","gravatar_id":"","url":"https://api.github.com/users/alfa-laboratory","html_url":"https://github.com/alfa-laboratory","followers_url":"https://api.github.com/users/alfa-laboratory/followers","following_url":"https://api.github.com/users/alfa-laboratory/following{/other_user}","gists_url":"https://api.github.com/users/alfa-laboratory/gists{/gist_id}","starred_url":"https://api.github.com/users/alfa-laboratory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alfa-laboratory/subscriptions","organizations_url":"https://api.github.com/users/alfa-laboratory/orgs","repos_url":"https://api.github.com/users/alfa-laboratory/repos","events_url":"https://api.github.com/users/alfa-laboratory/events{/privacy}","received_events_url":"https://api.github.com/users/alfa-laboratory/received_events","type":"Organization","site_admin":false},"repo":{"id":87942363,"name":"arui-feather","full_name":"alfa-laboratory/arui-feather","owner":{"login":"alfa-laboratory","id":20887020,"avatar_url":"https://avatars1.githubusercontent.com/u/20887020?v=4","gravatar_id":"","url":"https://api.github.com/users/alfa-laboratory","html_url":"https://github.com/alfa-laboratory","followers_url":"https://api.github.com/users/alfa-laboratory/followers","following_url":"https://api.github.com/users/alfa-laboratory/following{/other_user}","gists_url":"https://api.github.com/users/alfa-laboratory/gists{/gist_id}","starred_url":"https://api.github.com/users/alfa-laboratory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alfa-laboratory/subscriptions","organizations_url":"https://api.github.com/users/alfa-laboratory/orgs","repos_url":"https://api.github.com/users/alfa-laboratory/repos","events_url":"https://api.github.com/users/alfa-laboratory/events{/privacy}","received_events_url":"https://api.github.com/users/alfa-laboratory/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alfa-laboratory/arui-feather","description":"Alfa-Bank UI library","fork":false,"url":"https://api.github.com/repos/alfa-laboratory/arui-feather","forks_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/forks","keys_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/teams","hooks_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/hooks","issue_events_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/issues/events{/number}","events_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/events","assignees_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/assignees{/user}","branches_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/branches{/branch}","tags_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/tags","blobs_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/git/refs{/sha}","trees_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/statuses/{sha}","languages_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/languages","stargazers_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/stargazers","contributors_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/contributors","subscribers_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/subscribers","subscription_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/subscription","commits_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/commits{/sha}","git_commits_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/git/commits{/sha}","comments_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/comments{/number}","issue_comment_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/issues/comments{/number}","contents_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/contents/{+path}","compare_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/merges","archive_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/downloads","issues_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/issues{/number}","pulls_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/pulls{/number}","milestones_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/milestones{/number}","notifications_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/labels{/name}","releases_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/releases{/id}","deployments_url":"https://api.github.com/repos/alfa-laboratory/arui-feather/deployments","created_at":"2017-04-11T14:14:05Z","updated_at":"2018-02-05T12:30:33Z","pushed_at":"2018-02-12T12:31:58Z","git_url":"git://github.com/alfa-laboratory/arui-feather.git","ssh_url":"git@github.com:alfa-laboratory/arui-feather.git","clone_url":"https://github.com/alfa-laboratory/arui-feather.git","svn_url":"https://github.com/alfa-laboratory/arui-feather","homepage":"https://alfa-laboratory.github.io/arui-feather/styleguide/","size":69738,"stargazers_count":233,"watchers_count":233,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":42,"mirror_url":null,"archived":false,"open_issues_count":18,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":42,"open_issues":18,"watchers":233,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alfa-laboratory/arui-feather/pulls/514"},"html":{"href":"https://github.com/alfa-laboratory/arui-feather/pull/514"},"issue":{"href":"https://api.github.com/repos/alfa-laboratory/arui-feather/issues/514"},"comments":{"href":"https://api.github.com/repos/alfa-laboratory/arui-feather/issues/514/comments"},"review_comments":{"href":"https://api.github.com/repos/alfa-laboratory/arui-feather/pulls/514/comments"},"review_comment":{"href":"https://api.github.com/repos/alfa-laboratory/arui-feather/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alfa-laboratory/arui-feather/pulls/514/commits"},"statuses":{"href":"https://api.github.com/repos/alfa-laboratory/arui-feather/statuses/d7141008f083981eecae84e25c935fe52ecdf92d"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":3,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"astandrik"}}