{"action":"created","comment":{"url":"https://api.github.com/repos/stardust-ui/react/pulls/comments/233847404","pull_request_review_id":175355595,"id":233847404,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzg0NzQwNA==","diff_hunk":"@@ -22,18 +23,22 @@ export default class Ref extends Component<RefProps> {\n     children: PropTypes.element,\n \n     /**\n-     * Called when componentDidMount.\n+     * Called when a child component will be mounted or updated.\n      *\n      * @param {HTMLElement} node - Referred node.\n      */\n-    innerRef: PropTypes.func,\n+    innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n   }\n \n   componentDidMount() {\n-    _.invoke(this.props, 'innerRef', findDOMNode(this))\n+    handleRef(this.props, 'innerRef', findDOMNode(this))\n+  }\n+\n+  componentWillUnmount() {\n+    handleRef(this.props, 'innerRef', null)\n   }\n \n   render() {\n-    return this.props.children && Children.only(this.props.children)\n+    return this.props.children && React.Children.only(this.props.children)","path":"src/components/Ref/Ref.tsx","position":50,"original_position":50,"commit_id":"220df2e79a8796b0c75cae08324a55d96f428a69","original_commit_id":"1b7dfa6aa4d04033ab32a101a9b1030c0fc884d2","user":{"login":"layershifter","id":14183168,"node_id":"MDQ6VXNlcjE0MTgzMTY4","avatar_url":"https://avatars0.githubusercontent.com/u/14183168?v=4","gravatar_id":"","url":"https://api.github.com/users/layershifter","html_url":"https://github.com/layershifter","followers_url":"https://api.github.com/users/layershifter/followers","following_url":"https://api.github.com/users/layershifter/following{/other_user}","gists_url":"https://api.github.com/users/layershifter/gists{/gist_id}","starred_url":"https://api.github.com/users/layershifter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/layershifter/subscriptions","organizations_url":"https://api.github.com/users/layershifter/orgs","repos_url":"https://api.github.com/users/layershifter/repos","events_url":"https://api.github.com/users/layershifter/events{/privacy}","received_events_url":"https://api.github.com/users/layershifter/received_events","type":"User","site_admin":false},"body":"A `Children.only` will throw this exception for multiple children:\r\n\r\n```\r\nInvariant Violation: React.Children.only expected to receive a single React element child.\r\n```\r\n\r\nAnd it's safe API, API that doesn't allow to shoot the leg. Your proposal is not an improvement it allows non obvious and confusing behaviour. It changes the behaviour silently.\r\n\r\n- I will pass a single element and I will receive a single ref\r\n- I will pass multiple elements and I will receive only first ref 🤔 \r\n\r\n","created_at":"2018-11-15T13:49:29Z","updated_at":"2018-11-15T13:49:30Z","html_url":"https://github.com/stardust-ui/react/pull/459#discussion_r233847404","pull_request_url":"https://api.github.com/repos/stardust-ui/react/pulls/459","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/stardust-ui/react/pulls/comments/233847404"},"html":{"href":"https://github.com/stardust-ui/react/pull/459#discussion_r233847404"},"pull_request":{"href":"https://api.github.com/repos/stardust-ui/react/pulls/459"}},"in_reply_to_id":233433975},"pull_request":{"url":"https://api.github.com/repos/stardust-ui/react/pulls/459","id":229711281,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5NzExMjgx","html_url":"https://github.com/stardust-ui/react/pull/459","diff_url":"https://github.com/stardust-ui/react/pull/459.diff","patch_url":"https://github.com/stardust-ui/react/pull/459.patch","issue_url":"https://api.github.com/repos/stardust-ui/react/issues/459","number":459,"state":"open","locked":false,"title":"[RFC] feat(handleRef): add an util for handling passed refs","user":{"login":"layershifter","id":14183168,"node_id":"MDQ6VXNlcjE0MTgzMTY4","avatar_url":"https://avatars0.githubusercontent.com/u/14183168?v=4","gravatar_id":"","url":"https://api.github.com/users/layershifter","html_url":"https://github.com/layershifter","followers_url":"https://api.github.com/users/layershifter/followers","following_url":"https://api.github.com/users/layershifter/following{/other_user}","gists_url":"https://api.github.com/users/layershifter/gists{/gist_id}","starred_url":"https://api.github.com/users/layershifter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/layershifter/subscriptions","organizations_url":"https://api.github.com/users/layershifter/orgs","repos_url":"https://api.github.com/users/layershifter/repos","events_url":"https://api.github.com/users/layershifter/events{/privacy}","received_events_url":"https://api.github.com/users/layershifter/received_events","type":"User","site_admin":false},"body":"Addresses ideas from #417.\r\n\r\n---\r\n\r\nThis PR solves the first described problem. Our `Ref` component and other components should consistently support functional and `createRef()` API.\r\n\r\n### Goals\r\n\r\n- exports `Ref` component at top level\r\n- adds support of `createRef()` API for the `Ref` component with reusable `handleRef()` util","created_at":"2018-11-09T14:31:55Z","updated_at":"2018-11-15T13:49:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3e34b799d5669593afd34ce5eb270a4b8c3cd012","assignee":null,"assignees":[],"requested_reviewers":[{"login":"mnajdova","id":4512430,"node_id":"MDQ6VXNlcjQ1MTI0MzA=","avatar_url":"https://avatars2.githubusercontent.com/u/4512430?v=4","gravatar_id":"","url":"https://api.github.com/users/mnajdova","html_url":"https://github.com/mnajdova","followers_url":"https://api.github.com/users/mnajdova/followers","following_url":"https://api.github.com/users/mnajdova/following{/other_user}","gists_url":"https://api.github.com/users/mnajdova/gists{/gist_id}","starred_url":"https://api.github.com/users/mnajdova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnajdova/subscriptions","organizations_url":"https://api.github.com/users/mnajdova/orgs","repos_url":"https://api.github.com/users/mnajdova/repos","events_url":"https://api.github.com/users/mnajdova/events{/privacy}","received_events_url":"https://api.github.com/users/mnajdova/received_events","type":"User","site_admin":false},{"login":"levithomason","id":5067638,"node_id":"MDQ6VXNlcjUwNjc2Mzg=","avatar_url":"https://avatars3.githubusercontent.com/u/5067638?v=4","gravatar_id":"","url":"https://api.github.com/users/levithomason","html_url":"https://github.com/levithomason","followers_url":"https://api.github.com/users/levithomason/followers","following_url":"https://api.github.com/users/levithomason/following{/other_user}","gists_url":"https://api.github.com/users/levithomason/gists{/gist_id}","starred_url":"https://api.github.com/users/levithomason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/levithomason/subscriptions","organizations_url":"https://api.github.com/users/levithomason/orgs","repos_url":"https://api.github.com/users/levithomason/repos","events_url":"https://api.github.com/users/levithomason/events{/privacy}","received_events_url":"https://api.github.com/users/levithomason/received_events","type":"User","site_admin":false},{"login":"davezuko","id":6439050,"node_id":"MDQ6VXNlcjY0MzkwNTA=","avatar_url":"https://avatars3.githubusercontent.com/u/6439050?v=4","gravatar_id":"","url":"https://api.github.com/users/davezuko","html_url":"https://github.com/davezuko","followers_url":"https://api.github.com/users/davezuko/followers","following_url":"https://api.github.com/users/davezuko/following{/other_user}","gists_url":"https://api.github.com/users/davezuko/gists{/gist_id}","starred_url":"https://api.github.com/users/davezuko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davezuko/subscriptions","organizations_url":"https://api.github.com/users/davezuko/orgs","repos_url":"https://api.github.com/users/davezuko/repos","events_url":"https://api.github.com/users/davezuko/events{/privacy}","received_events_url":"https://api.github.com/users/davezuko/received_events","type":"User","site_admin":false},{"login":"miroslavstastny","id":9615899,"node_id":"MDQ6VXNlcjk2MTU4OTk=","avatar_url":"https://avatars0.githubusercontent.com/u/9615899?v=4","gravatar_id":"","url":"https://api.github.com/users/miroslavstastny","html_url":"https://github.com/miroslavstastny","followers_url":"https://api.github.com/users/miroslavstastny/followers","following_url":"https://api.github.com/users/miroslavstastny/following{/other_user}","gists_url":"https://api.github.com/users/miroslavstastny/gists{/gist_id}","starred_url":"https://api.github.com/users/miroslavstastny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miroslavstastny/subscriptions","organizations_url":"https://api.github.com/users/miroslavstastny/orgs","repos_url":"https://api.github.com/users/miroslavstastny/repos","events_url":"https://api.github.com/users/miroslavstastny/events{/privacy}","received_events_url":"https://api.github.com/users/miroslavstastny/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":1026600697,"node_id":"MDU6TGFiZWwxMDI2NjAwNjk3","url":"https://api.github.com/repos/stardust-ui/react/labels/RFC","name":"RFC","color":"0052cc","default":false},{"id":1000064870,"node_id":"MDU6TGFiZWwxMDAwMDY0ODcw","url":"https://api.github.com/repos/stardust-ui/react/labels/enhancement","name":"enhancement","color":"a2eeef","default":true},{"id":1025398911,"node_id":"MDU6TGFiZWwxMDI1Mzk4OTEx","url":"https://api.github.com/repos/stardust-ui/react/labels/needs%20author%20feedback","name":"needs author feedback","color":"e4e669","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/stardust-ui/react/pulls/459/commits","review_comments_url":"https://api.github.com/repos/stardust-ui/react/pulls/459/comments","review_comment_url":"https://api.github.com/repos/stardust-ui/react/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stardust-ui/react/issues/459/comments","statuses_url":"https://api.github.com/repos/stardust-ui/react/statuses/220df2e79a8796b0c75cae08324a55d96f428a69","head":{"label":"stardust-ui:feat/handle-refd","ref":"feat/handle-refd","sha":"220df2e79a8796b0c75cae08324a55d96f428a69","user":{"login":"stardust-ui","id":40412095,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNDEyMDk1","avatar_url":"https://avatars3.githubusercontent.com/u/40412095?v=4","gravatar_id":"","url":"https://api.github.com/users/stardust-ui","html_url":"https://github.com/stardust-ui","followers_url":"https://api.github.com/users/stardust-ui/followers","following_url":"https://api.github.com/users/stardust-ui/following{/other_user}","gists_url":"https://api.github.com/users/stardust-ui/gists{/gist_id}","starred_url":"https://api.github.com/users/stardust-ui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stardust-ui/subscriptions","organizations_url":"https://api.github.com/users/stardust-ui/orgs","repos_url":"https://api.github.com/users/stardust-ui/repos","events_url":"https://api.github.com/users/stardust-ui/events{/privacy}","received_events_url":"https://api.github.com/users/stardust-ui/received_events","type":"Organization","site_admin":false},"repo":{"id":141743704,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE3NDM3MDQ=","name":"react","full_name":"stardust-ui/react","private":false,"owner":{"login":"stardust-ui","id":40412095,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNDEyMDk1","avatar_url":"https://avatars3.githubusercontent.com/u/40412095?v=4","gravatar_id":"","url":"https://api.github.com/users/stardust-ui","html_url":"https://github.com/stardust-ui","followers_url":"https://api.github.com/users/stardust-ui/followers","following_url":"https://api.github.com/users/stardust-ui/following{/other_user}","gists_url":"https://api.github.com/users/stardust-ui/gists{/gist_id}","starred_url":"https://api.github.com/users/stardust-ui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stardust-ui/subscriptions","organizations_url":"https://api.github.com/users/stardust-ui/orgs","repos_url":"https://api.github.com/users/stardust-ui/repos","events_url":"https://api.github.com/users/stardust-ui/events{/privacy}","received_events_url":"https://api.github.com/users/stardust-ui/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/stardust-ui/react","description":"A themable React component library","fork":false,"url":"https://api.github.com/repos/stardust-ui/react","forks_url":"https://api.github.com/repos/stardust-ui/react/forks","keys_url":"https://api.github.com/repos/stardust-ui/react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stardust-ui/react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stardust-ui/react/teams","hooks_url":"https://api.github.com/repos/stardust-ui/react/hooks","issue_events_url":"https://api.github.com/repos/stardust-ui/react/issues/events{/number}","events_url":"https://api.github.com/repos/stardust-ui/react/events","assignees_url":"https://api.github.com/repos/stardust-ui/react/assignees{/user}","branches_url":"https://api.github.com/repos/stardust-ui/react/branches{/branch}","tags_url":"https://api.github.com/repos/stardust-ui/react/tags","blobs_url":"https://api.github.com/repos/stardust-ui/react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stardust-ui/react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stardust-ui/react/git/refs{/sha}","trees_url":"https://api.github.com/repos/stardust-ui/react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stardust-ui/react/statuses/{sha}","languages_url":"https://api.github.com/repos/stardust-ui/react/languages","stargazers_url":"https://api.github.com/repos/stardust-ui/react/stargazers","contributors_url":"https://api.github.com/repos/stardust-ui/react/contributors","subscribers_url":"https://api.github.com/repos/stardust-ui/react/subscribers","subscription_url":"https://api.github.com/repos/stardust-ui/react/subscription","commits_url":"https://api.github.com/repos/stardust-ui/react/commits{/sha}","git_commits_url":"https://api.github.com/repos/stardust-ui/react/git/commits{/sha}","comments_url":"https://api.github.com/repos/stardust-ui/react/comments{/number}","issue_comment_url":"https://api.github.com/repos/stardust-ui/react/issues/comments{/number}","contents_url":"https://api.github.com/repos/stardust-ui/react/contents/{+path}","compare_url":"https://api.github.com/repos/stardust-ui/react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stardust-ui/react/merges","archive_url":"https://api.github.com/repos/stardust-ui/react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stardust-ui/react/downloads","issues_url":"https://api.github.com/repos/stardust-ui/react/issues{/number}","pulls_url":"https://api.github.com/repos/stardust-ui/react/pulls{/number}","milestones_url":"https://api.github.com/repos/stardust-ui/react/milestones{/number}","notifications_url":"https://api.github.com/repos/stardust-ui/react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stardust-ui/react/labels{/name}","releases_url":"https://api.github.com/repos/stardust-ui/react/releases{/id}","deployments_url":"https://api.github.com/repos/stardust-ui/react/deployments","created_at":"2018-07-20T18:12:35Z","updated_at":"2018-11-15T12:16:59Z","pushed_at":"2018-11-15T13:42:17Z","git_url":"git://github.com/stardust-ui/react.git","ssh_url":"git@github.com:stardust-ui/react.git","clone_url":"https://github.com/stardust-ui/react.git","svn_url":"https://github.com/stardust-ui/react","homepage":"http://stardust-ui.github.io/react","size":28701,"stargazers_count":103,"watchers_count":103,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":111,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":15,"open_issues":111,"watchers":103,"default_branch":"master"}},"base":{"label":"stardust-ui:master","ref":"master","sha":"7509779ef4eb4b938033c8a249f7e0fca0c4ce9f","user":{"login":"stardust-ui","id":40412095,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNDEyMDk1","avatar_url":"https://avatars3.githubusercontent.com/u/40412095?v=4","gravatar_id":"","url":"https://api.github.com/users/stardust-ui","html_url":"https://github.com/stardust-ui","followers_url":"https://api.github.com/users/stardust-ui/followers","following_url":"https://api.github.com/users/stardust-ui/following{/other_user}","gists_url":"https://api.github.com/users/stardust-ui/gists{/gist_id}","starred_url":"https://api.github.com/users/stardust-ui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stardust-ui/subscriptions","organizations_url":"https://api.github.com/users/stardust-ui/orgs","repos_url":"https://api.github.com/users/stardust-ui/repos","events_url":"https://api.github.com/users/stardust-ui/events{/privacy}","received_events_url":"https://api.github.com/users/stardust-ui/received_events","type":"Organization","site_admin":false},"repo":{"id":141743704,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE3NDM3MDQ=","name":"react","full_name":"stardust-ui/react","private":false,"owner":{"login":"stardust-ui","id":40412095,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNDEyMDk1","avatar_url":"https://avatars3.githubusercontent.com/u/40412095?v=4","gravatar_id":"","url":"https://api.github.com/users/stardust-ui","html_url":"https://github.com/stardust-ui","followers_url":"https://api.github.com/users/stardust-ui/followers","following_url":"https://api.github.com/users/stardust-ui/following{/other_user}","gists_url":"https://api.github.com/users/stardust-ui/gists{/gist_id}","starred_url":"https://api.github.com/users/stardust-ui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stardust-ui/subscriptions","organizations_url":"https://api.github.com/users/stardust-ui/orgs","repos_url":"https://api.github.com/users/stardust-ui/repos","events_url":"https://api.github.com/users/stardust-ui/events{/privacy}","received_events_url":"https://api.github.com/users/stardust-ui/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/stardust-ui/react","description":"A themable React component library","fork":false,"url":"https://api.github.com/repos/stardust-ui/react","forks_url":"https://api.github.com/repos/stardust-ui/react/forks","keys_url":"https://api.github.com/repos/stardust-ui/react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stardust-ui/react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stardust-ui/react/teams","hooks_url":"https://api.github.com/repos/stardust-ui/react/hooks","issue_events_url":"https://api.github.com/repos/stardust-ui/react/issues/events{/number}","events_url":"https://api.github.com/repos/stardust-ui/react/events","assignees_url":"https://api.github.com/repos/stardust-ui/react/assignees{/user}","branches_url":"https://api.github.com/repos/stardust-ui/react/branches{/branch}","tags_url":"https://api.github.com/repos/stardust-ui/react/tags","blobs_url":"https://api.github.com/repos/stardust-ui/react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stardust-ui/react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stardust-ui/react/git/refs{/sha}","trees_url":"https://api.github.com/repos/stardust-ui/react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stardust-ui/react/statuses/{sha}","languages_url":"https://api.github.com/repos/stardust-ui/react/languages","stargazers_url":"https://api.github.com/repos/stardust-ui/react/stargazers","contributors_url":"https://api.github.com/repos/stardust-ui/react/contributors","subscribers_url":"https://api.github.com/repos/stardust-ui/react/subscribers","subscription_url":"https://api.github.com/repos/stardust-ui/react/subscription","commits_url":"https://api.github.com/repos/stardust-ui/react/commits{/sha}","git_commits_url":"https://api.github.com/repos/stardust-ui/react/git/commits{/sha}","comments_url":"https://api.github.com/repos/stardust-ui/react/comments{/number}","issue_comment_url":"https://api.github.com/repos/stardust-ui/react/issues/comments{/number}","contents_url":"https://api.github.com/repos/stardust-ui/react/contents/{+path}","compare_url":"https://api.github.com/repos/stardust-ui/react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stardust-ui/react/merges","archive_url":"https://api.github.com/repos/stardust-ui/react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stardust-ui/react/downloads","issues_url":"https://api.github.com/repos/stardust-ui/react/issues{/number}","pulls_url":"https://api.github.com/repos/stardust-ui/react/pulls{/number}","milestones_url":"https://api.github.com/repos/stardust-ui/react/milestones{/number}","notifications_url":"https://api.github.com/repos/stardust-ui/react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stardust-ui/react/labels{/name}","releases_url":"https://api.github.com/repos/stardust-ui/react/releases{/id}","deployments_url":"https://api.github.com/repos/stardust-ui/react/deployments","created_at":"2018-07-20T18:12:35Z","updated_at":"2018-11-15T12:16:59Z","pushed_at":"2018-11-15T13:42:17Z","git_url":"git://github.com/stardust-ui/react.git","ssh_url":"git@github.com:stardust-ui/react.git","clone_url":"https://github.com/stardust-ui/react.git","svn_url":"https://github.com/stardust-ui/react","homepage":"http://stardust-ui.github.io/react","size":28701,"stargazers_count":103,"watchers_count":103,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":111,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":15,"open_issues":111,"watchers":103,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stardust-ui/react/pulls/459"},"html":{"href":"https://github.com/stardust-ui/react/pull/459"},"issue":{"href":"https://api.github.com/repos/stardust-ui/react/issues/459"},"comments":{"href":"https://api.github.com/repos/stardust-ui/react/issues/459/comments"},"review_comments":{"href":"https://api.github.com/repos/stardust-ui/react/pulls/459/comments"},"review_comment":{"href":"https://api.github.com/repos/stardust-ui/react/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stardust-ui/react/pulls/459/commits"},"statuses":{"href":"https://api.github.com/repos/stardust-ui/react/statuses/220df2e79a8796b0c75cae08324a55d96f428a69"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"layershifter"}}