{"action":"created","comment":{"url":"https://api.github.com/repos/chenglou/react-radio-group/pulls/comments/44474452","id":44474452,"diff_hunk":"@@ -1,15 +1,27 @@\n import React, {PropTypes} from 'react';\n \n-function radio(name, selectedValue, onChange) {\n+function radio(kwargs) {\n+\n   return React.createClass({\n     render: function() {\n+      const name = kwargs.name;\n+\n+      // We only want to assign these attribute to the <input />\n+      // elements if they were specified explicitly.\n+      const optional = {};\n+      if(kwargs.hasOwnProperty(\"selectedValue\")) {","path":"index.jsx","position":13,"original_position":13,"commit_id":"d91b860a695ed13df0f3f89f0bd3d7f93d509250","original_commit_id":"d91b860a695ed13df0f3f89f0bd3d7f93d509250","user":{"login":"nkbt","id":175264,"avatar_url":"https://avatars.githubusercontent.com/u/175264?v=3","gravatar_id":"","url":"https://api.github.com/users/nkbt","html_url":"https://github.com/nkbt","followers_url":"https://api.github.com/users/nkbt/followers","following_url":"https://api.github.com/users/nkbt/following{/other_user}","gists_url":"https://api.github.com/users/nkbt/gists{/gist_id}","starred_url":"https://api.github.com/users/nkbt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkbt/subscriptions","organizations_url":"https://api.github.com/users/nkbt/orgs","repos_url":"https://api.github.com/users/nkbt/repos","events_url":"https://api.github.com/users/nkbt/events{/privacy}","received_events_url":"https://api.github.com/users/nkbt/received_events","type":"User","site_admin":false},"body":"I am pretty sure you can use `selectedValue === undefined` and keep the same code","created_at":"2015-11-10T22:21:39Z","updated_at":"2015-11-10T22:21:39Z","html_url":"https://github.com/chenglou/react-radio-group/pull/22#discussion_r44474452","pull_request_url":"https://api.github.com/repos/chenglou/react-radio-group/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/chenglou/react-radio-group/pulls/comments/44474452"},"html":{"href":"https://github.com/chenglou/react-radio-group/pull/22#discussion_r44474452"},"pull_request":{"href":"https://api.github.com/repos/chenglou/react-radio-group/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/chenglou/react-radio-group/pulls/22","id":50312841,"html_url":"https://github.com/chenglou/react-radio-group/pull/22","diff_url":"https://github.com/chenglou/react-radio-group/pull/22.diff","patch_url":"https://github.com/chenglou/react-radio-group/pull/22.patch","issue_url":"https://api.github.com/repos/chenglou/react-radio-group/issues/22","number":22,"state":"open","locked":false,"title":"'selectedValue' and 'onChange' are optional","user":{"login":"briandamaged","id":372750,"avatar_url":"https://avatars.githubusercontent.com/u/372750?v=3","gravatar_id":"","url":"https://api.github.com/users/briandamaged","html_url":"https://github.com/briandamaged","followers_url":"https://api.github.com/users/briandamaged/followers","following_url":"https://api.github.com/users/briandamaged/following{/other_user}","gists_url":"https://api.github.com/users/briandamaged/gists{/gist_id}","starred_url":"https://api.github.com/users/briandamaged/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briandamaged/subscriptions","organizations_url":"https://api.github.com/users/briandamaged/orgs","repos_url":"https://api.github.com/users/briandamaged/repos","events_url":"https://api.github.com/users/briandamaged/events{/privacy}","received_events_url":"https://api.github.com/users/briandamaged/received_events","type":"User","site_admin":false},"body":"More precisely: they are only passed to the <input /> elements\r\nwhen they are specified explicitly.  Consequently, this allows\r\nthe RadioGroup to be used as a non-controlled component.  In\r\nother words, Radio buttons are no longer read-only by default.\r\n\r\nThis addresses ticket #17","created_at":"2015-11-10T21:21:02Z","updated_at":"2015-11-10T22:21:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f2e2e627dc5be71336754a439305c0e7a000192","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chenglou/react-radio-group/pulls/22/commits","review_comments_url":"https://api.github.com/repos/chenglou/react-radio-group/pulls/22/comments","review_comment_url":"https://api.github.com/repos/chenglou/react-radio-group/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chenglou/react-radio-group/issues/22/comments","statuses_url":"https://api.github.com/repos/chenglou/react-radio-group/statuses/d91b860a695ed13df0f3f89f0bd3d7f93d509250","head":{"label":"briandamaged:master","ref":"master","sha":"d91b860a695ed13df0f3f89f0bd3d7f93d509250","user":{"login":"briandamaged","id":372750,"avatar_url":"https://avatars.githubusercontent.com/u/372750?v=3","gravatar_id":"","url":"https://api.github.com/users/briandamaged","html_url":"https://github.com/briandamaged","followers_url":"https://api.github.com/users/briandamaged/followers","following_url":"https://api.github.com/users/briandamaged/following{/other_user}","gists_url":"https://api.github.com/users/briandamaged/gists{/gist_id}","starred_url":"https://api.github.com/users/briandamaged/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briandamaged/subscriptions","organizations_url":"https://api.github.com/users/briandamaged/orgs","repos_url":"https://api.github.com/users/briandamaged/repos","events_url":"https://api.github.com/users/briandamaged/events{/privacy}","received_events_url":"https://api.github.com/users/briandamaged/received_events","type":"User","site_admin":false},"repo":{"id":45937296,"name":"react-radio-group","full_name":"briandamaged/react-radio-group","owner":{"login":"briandamaged","id":372750,"avatar_url":"https://avatars.githubusercontent.com/u/372750?v=3","gravatar_id":"","url":"https://api.github.com/users/briandamaged","html_url":"https://github.com/briandamaged","followers_url":"https://api.github.com/users/briandamaged/followers","following_url":"https://api.github.com/users/briandamaged/following{/other_user}","gists_url":"https://api.github.com/users/briandamaged/gists{/gist_id}","starred_url":"https://api.github.com/users/briandamaged/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briandamaged/subscriptions","organizations_url":"https://api.github.com/users/briandamaged/orgs","repos_url":"https://api.github.com/users/briandamaged/repos","events_url":"https://api.github.com/users/briandamaged/events{/privacy}","received_events_url":"https://api.github.com/users/briandamaged/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/briandamaged/react-radio-group","description":"Better radio buttons.","fork":true,"url":"https://api.github.com/repos/briandamaged/react-radio-group","forks_url":"https://api.github.com/repos/briandamaged/react-radio-group/forks","keys_url":"https://api.github.com/repos/briandamaged/react-radio-group/keys{/key_id}","collaborators_url":"https://api.github.com/repos/briandamaged/react-radio-group/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/briandamaged/react-radio-group/teams","hooks_url":"https://api.github.com/repos/briandamaged/react-radio-group/hooks","issue_events_url":"https://api.github.com/repos/briandamaged/react-radio-group/issues/events{/number}","events_url":"https://api.github.com/repos/briandamaged/react-radio-group/events","assignees_url":"https://api.github.com/repos/briandamaged/react-radio-group/assignees{/user}","branches_url":"https://api.github.com/repos/briandamaged/react-radio-group/branches{/branch}","tags_url":"https://api.github.com/repos/briandamaged/react-radio-group/tags","blobs_url":"https://api.github.com/repos/briandamaged/react-radio-group/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/briandamaged/react-radio-group/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/briandamaged/react-radio-group/git/refs{/sha}","trees_url":"https://api.github.com/repos/briandamaged/react-radio-group/git/trees{/sha}","statuses_url":"https://api.github.com/repos/briandamaged/react-radio-group/statuses/{sha}","languages_url":"https://api.github.com/repos/briandamaged/react-radio-group/languages","stargazers_url":"https://api.github.com/repos/briandamaged/react-radio-group/stargazers","contributors_url":"https://api.github.com/repos/briandamaged/react-radio-group/contributors","subscribers_url":"https://api.github.com/repos/briandamaged/react-radio-group/subscribers","subscription_url":"https://api.github.com/repos/briandamaged/react-radio-group/subscription","commits_url":"https://api.github.com/repos/briandamaged/react-radio-group/commits{/sha}","git_commits_url":"https://api.github.com/repos/briandamaged/react-radio-group/git/commits{/sha}","comments_url":"https://api.github.com/repos/briandamaged/react-radio-group/comments{/number}","issue_comment_url":"https://api.github.com/repos/briandamaged/react-radio-group/issues/comments{/number}","contents_url":"https://api.github.com/repos/briandamaged/react-radio-group/contents/{+path}","compare_url":"https://api.github.com/repos/briandamaged/react-radio-group/compare/{base}...{head}","merges_url":"https://api.github.com/repos/briandamaged/react-radio-group/merges","archive_url":"https://api.github.com/repos/briandamaged/react-radio-group/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/briandamaged/react-radio-group/downloads","issues_url":"https://api.github.com/repos/briandamaged/react-radio-group/issues{/number}","pulls_url":"https://api.github.com/repos/briandamaged/react-radio-group/pulls{/number}","milestones_url":"https://api.github.com/repos/briandamaged/react-radio-group/milestones{/number}","notifications_url":"https://api.github.com/repos/briandamaged/react-radio-group/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/briandamaged/react-radio-group/labels{/name}","releases_url":"https://api.github.com/repos/briandamaged/react-radio-group/releases{/id}","created_at":"2015-11-10T20:08:21Z","updated_at":"2015-11-10T20:08:23Z","pushed_at":"2015-11-10T21:32:32Z","git_url":"git://github.com/briandamaged/react-radio-group.git","ssh_url":"git@github.com:briandamaged/react-radio-group.git","clone_url":"https://github.com/briandamaged/react-radio-group.git","svn_url":"https://github.com/briandamaged/react-radio-group","homepage":"","size":110,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"chenglou:master","ref":"master","sha":"cff14d298b7f34c0eaf126a573c4dd4799b5b0a9","user":{"login":"chenglou","id":1909539,"avatar_url":"https://avatars.githubusercontent.com/u/1909539?v=3","gravatar_id":"","url":"https://api.github.com/users/chenglou","html_url":"https://github.com/chenglou","followers_url":"https://api.github.com/users/chenglou/followers","following_url":"https://api.github.com/users/chenglou/following{/other_user}","gists_url":"https://api.github.com/users/chenglou/gists{/gist_id}","starred_url":"https://api.github.com/users/chenglou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenglou/subscriptions","organizations_url":"https://api.github.com/users/chenglou/orgs","repos_url":"https://api.github.com/users/chenglou/repos","events_url":"https://api.github.com/users/chenglou/events{/privacy}","received_events_url":"https://api.github.com/users/chenglou/received_events","type":"User","site_admin":false},"repo":{"id":11699056,"name":"react-radio-group","full_name":"chenglou/react-radio-group","owner":{"login":"chenglou","id":1909539,"avatar_url":"https://avatars.githubusercontent.com/u/1909539?v=3","gravatar_id":"","url":"https://api.github.com/users/chenglou","html_url":"https://github.com/chenglou","followers_url":"https://api.github.com/users/chenglou/followers","following_url":"https://api.github.com/users/chenglou/following{/other_user}","gists_url":"https://api.github.com/users/chenglou/gists{/gist_id}","starred_url":"https://api.github.com/users/chenglou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenglou/subscriptions","organizations_url":"https://api.github.com/users/chenglou/orgs","repos_url":"https://api.github.com/users/chenglou/repos","events_url":"https://api.github.com/users/chenglou/events{/privacy}","received_events_url":"https://api.github.com/users/chenglou/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chenglou/react-radio-group","description":"Better radio buttons.","fork":false,"url":"https://api.github.com/repos/chenglou/react-radio-group","forks_url":"https://api.github.com/repos/chenglou/react-radio-group/forks","keys_url":"https://api.github.com/repos/chenglou/react-radio-group/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chenglou/react-radio-group/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chenglou/react-radio-group/teams","hooks_url":"https://api.github.com/repos/chenglou/react-radio-group/hooks","issue_events_url":"https://api.github.com/repos/chenglou/react-radio-group/issues/events{/number}","events_url":"https://api.github.com/repos/chenglou/react-radio-group/events","assignees_url":"https://api.github.com/repos/chenglou/react-radio-group/assignees{/user}","branches_url":"https://api.github.com/repos/chenglou/react-radio-group/branches{/branch}","tags_url":"https://api.github.com/repos/chenglou/react-radio-group/tags","blobs_url":"https://api.github.com/repos/chenglou/react-radio-group/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chenglou/react-radio-group/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chenglou/react-radio-group/git/refs{/sha}","trees_url":"https://api.github.com/repos/chenglou/react-radio-group/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chenglou/react-radio-group/statuses/{sha}","languages_url":"https://api.github.com/repos/chenglou/react-radio-group/languages","stargazers_url":"https://api.github.com/repos/chenglou/react-radio-group/stargazers","contributors_url":"https://api.github.com/repos/chenglou/react-radio-group/contributors","subscribers_url":"https://api.github.com/repos/chenglou/react-radio-group/subscribers","subscription_url":"https://api.github.com/repos/chenglou/react-radio-group/subscription","commits_url":"https://api.github.com/repos/chenglou/react-radio-group/commits{/sha}","git_commits_url":"https://api.github.com/repos/chenglou/react-radio-group/git/commits{/sha}","comments_url":"https://api.github.com/repos/chenglou/react-radio-group/comments{/number}","issue_comment_url":"https://api.github.com/repos/chenglou/react-radio-group/issues/comments{/number}","contents_url":"https://api.github.com/repos/chenglou/react-radio-group/contents/{+path}","compare_url":"https://api.github.com/repos/chenglou/react-radio-group/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chenglou/react-radio-group/merges","archive_url":"https://api.github.com/repos/chenglou/react-radio-group/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chenglou/react-radio-group/downloads","issues_url":"https://api.github.com/repos/chenglou/react-radio-group/issues{/number}","pulls_url":"https://api.github.com/repos/chenglou/react-radio-group/pulls{/number}","milestones_url":"https://api.github.com/repos/chenglou/react-radio-group/milestones{/number}","notifications_url":"https://api.github.com/repos/chenglou/react-radio-group/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chenglou/react-radio-group/labels{/name}","releases_url":"https://api.github.com/repos/chenglou/react-radio-group/releases{/id}","created_at":"2013-07-27T03:02:51Z","updated_at":"2015-11-07T08:12:33Z","pushed_at":"2015-11-10T21:21:03Z","git_url":"git://github.com/chenglou/react-radio-group.git","ssh_url":"git@github.com:chenglou/react-radio-group.git","clone_url":"https://github.com/chenglou/react-radio-group.git","svn_url":"https://github.com/chenglou/react-radio-group","homepage":"","size":345,"stargazers_count":129,"watchers_count":129,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":6,"forks":20,"open_issues":6,"watchers":129,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chenglou/react-radio-group/pulls/22"},"html":{"href":"https://github.com/chenglou/react-radio-group/pull/22"},"issue":{"href":"https://api.github.com/repos/chenglou/react-radio-group/issues/22"},"comments":{"href":"https://api.github.com/repos/chenglou/react-radio-group/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/chenglou/react-radio-group/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/chenglou/react-radio-group/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chenglou/react-radio-group/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/chenglou/react-radio-group/statuses/d91b860a695ed13df0f3f89f0bd3d7f93d509250"}}}}