{"action":"created","comment":{"url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/pulls/comments/218789562","pull_request_review_id":156802368,"id":218789562,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODc4OTU2Mg==","diff_hunk":"@@ -77,11 +81,34 @@ export default class TooltipTrigger extends PureComponent {\n     defaultTooltipShown: false,\n     placement: 'right',\n     trigger: 'hover',\n-    closeOnOutOfBoundaries: true\n+    closeOnOutOfBoundaries: true,\n+    onVisibilityChange: noop\n   };\n \n   state = {\n-    tooltipShown: this.props.defaultTooltipShown\n+    tooltipShown: this._isControlled()\n+      ? undefined\n+      : this.props.defaultTooltipShown || false\n+  };\n+\n+  _isControlled() {\n+    return this.props.tooltipShown !== undefined;","path":"src/TooltipTrigger.js","position":37,"original_position":37,"commit_id":"f79b497cad4fc664e78aa6bb72b94c855d58be92","original_commit_id":"c90daefa5226daf7d35cd281d05b4968b82c7104","user":{"login":"denisborovikov","id":831065,"node_id":"MDQ6VXNlcjgzMTA2NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/831065?v=4","gravatar_id":"","url":"https://api.github.com/users/denisborovikov","html_url":"https://github.com/denisborovikov","followers_url":"https://api.github.com/users/denisborovikov/followers","following_url":"https://api.github.com/users/denisborovikov/following{/other_user}","gists_url":"https://api.github.com/users/denisborovikov/gists{/gist_id}","starred_url":"https://api.github.com/users/denisborovikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denisborovikov/subscriptions","organizations_url":"https://api.github.com/users/denisborovikov/orgs","repos_url":"https://api.github.com/users/denisborovikov/repos","events_url":"https://api.github.com/users/denisborovikov/events{/privacy}","received_events_url":"https://api.github.com/users/denisborovikov/received_events","type":"User","site_admin":false},"body":"We have PropTypes for such checks. It's boolean or undefined for sure.","created_at":"2018-09-19T12:50:57Z","updated_at":"2018-09-19T12:50:57Z","html_url":"https://github.com/mohsinulhaq/react-popper-tooltip/pull/11#discussion_r218789562","pull_request_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/pulls/11","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/pulls/comments/218789562"},"html":{"href":"https://github.com/mohsinulhaq/react-popper-tooltip/pull/11#discussion_r218789562"},"pull_request":{"href":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/pulls/11"}},"in_reply_to_id":218787653},"pull_request":{"url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/pulls/11","id":216618993,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2NjE4OTkz","html_url":"https://github.com/mohsinulhaq/react-popper-tooltip/pull/11","diff_url":"https://github.com/mohsinulhaq/react-popper-tooltip/pull/11.diff","patch_url":"https://github.com/mohsinulhaq/react-popper-tooltip/pull/11.patch","issue_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/issues/11","number":11,"state":"open","locked":false,"title":"Add onVisibilityChange, update README","user":{"login":"denisborovikov","id":831065,"node_id":"MDQ6VXNlcjgzMTA2NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/831065?v=4","gravatar_id":"","url":"https://api.github.com/users/denisborovikov","html_url":"https://github.com/denisborovikov","followers_url":"https://api.github.com/users/denisborovikov/followers","following_url":"https://api.github.com/users/denisborovikov/following{/other_user}","gists_url":"https://api.github.com/users/denisborovikov/gists{/gist_id}","starred_url":"https://api.github.com/users/denisborovikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denisborovikov/subscriptions","organizations_url":"https://api.github.com/users/denisborovikov/orgs","repos_url":"https://api.github.com/users/denisborovikov/repos","events_url":"https://api.github.com/users/denisborovikov/events{/privacy}","received_events_url":"https://api.github.com/users/denisborovikov/received_events","type":"User","site_admin":false},"body":"I've added `onVisibilityChange` callback which invoked every time the tooltip visibility state changes. \r\n\r\nI also made the refactor. Now if the component controlled (`tooltipShown` prop and external state used), our code doesn't have the internal state at all and completely rely on external `tooltipShown` \r\n\r\nThat means we can remove `getDerivedStateFromProps` as we don't need to synchronize the internal state with external changes.\r\n\r\nI also updated the README according to the new changes and removed the `TooltipTrigger` ref part. We shouldn't recommend using the ref this way.","created_at":"2018-09-19T12:22:09Z","updated_at":"2018-09-19T12:50:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8299f21facb92a956fa4c1d81d4165b0cfd2ddd8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/pulls/11/commits","review_comments_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/pulls/11/comments","review_comment_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/issues/11/comments","statuses_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/statuses/f79b497cad4fc664e78aa6bb72b94c855d58be92","head":{"label":"mohsinulhaq:control-prop","ref":"control-prop","sha":"f79b497cad4fc664e78aa6bb72b94c855d58be92","user":{"login":"mohsinulhaq","id":7688231,"node_id":"MDQ6VXNlcjc2ODgyMzE=","avatar_url":"https://avatars1.githubusercontent.com/u/7688231?v=4","gravatar_id":"","url":"https://api.github.com/users/mohsinulhaq","html_url":"https://github.com/mohsinulhaq","followers_url":"https://api.github.com/users/mohsinulhaq/followers","following_url":"https://api.github.com/users/mohsinulhaq/following{/other_user}","gists_url":"https://api.github.com/users/mohsinulhaq/gists{/gist_id}","starred_url":"https://api.github.com/users/mohsinulhaq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mohsinulhaq/subscriptions","organizations_url":"https://api.github.com/users/mohsinulhaq/orgs","repos_url":"https://api.github.com/users/mohsinulhaq/repos","events_url":"https://api.github.com/users/mohsinulhaq/events{/privacy}","received_events_url":"https://api.github.com/users/mohsinulhaq/received_events","type":"User","site_admin":false},"repo":{"id":144013186,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQwMTMxODY=","name":"react-popper-tooltip","full_name":"mohsinulhaq/react-popper-tooltip","private":false,"owner":{"login":"mohsinulhaq","id":7688231,"node_id":"MDQ6VXNlcjc2ODgyMzE=","avatar_url":"https://avatars1.githubusercontent.com/u/7688231?v=4","gravatar_id":"","url":"https://api.github.com/users/mohsinulhaq","html_url":"https://github.com/mohsinulhaq","followers_url":"https://api.github.com/users/mohsinulhaq/followers","following_url":"https://api.github.com/users/mohsinulhaq/following{/other_user}","gists_url":"https://api.github.com/users/mohsinulhaq/gists{/gist_id}","starred_url":"https://api.github.com/users/mohsinulhaq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mohsinulhaq/subscriptions","organizations_url":"https://api.github.com/users/mohsinulhaq/orgs","repos_url":"https://api.github.com/users/mohsinulhaq/repos","events_url":"https://api.github.com/users/mohsinulhaq/events{/privacy}","received_events_url":"https://api.github.com/users/mohsinulhaq/received_events","type":"User","site_admin":false},"html_url":"https://github.com/mohsinulhaq/react-popper-tooltip","description":"React tooltip library built around react-popper","fork":false,"url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip","forks_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/forks","keys_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/teams","hooks_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/hooks","issue_events_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/issues/events{/number}","events_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/events","assignees_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/assignees{/user}","branches_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/branches{/branch}","tags_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/tags","blobs_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/git/refs{/sha}","trees_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/statuses/{sha}","languages_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/languages","stargazers_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/stargazers","contributors_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/contributors","subscribers_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/subscribers","subscription_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/subscription","commits_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/commits{/sha}","git_commits_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/git/commits{/sha}","comments_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/comments{/number}","issue_comment_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/issues/comments{/number}","contents_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/contents/{+path}","compare_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/merges","archive_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/downloads","issues_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/issues{/number}","pulls_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/pulls{/number}","milestones_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/milestones{/number}","notifications_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/labels{/name}","releases_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/releases{/id}","deployments_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/deployments","created_at":"2018-08-08T12:51:19Z","updated_at":"2018-09-19T11:27:50Z","pushed_at":"2018-09-19T12:42:03Z","git_url":"git://github.com/mohsinulhaq/react-popper-tooltip.git","ssh_url":"git@github.com:mohsinulhaq/react-popper-tooltip.git","clone_url":"https://github.com/mohsinulhaq/react-popper-tooltip.git","svn_url":"https://github.com/mohsinulhaq/react-popper-tooltip","homepage":"https://www.npmjs.com/package/react-popper-tooltip","size":143,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2,"open_issues":2,"watchers":5,"default_branch":"master"}},"base":{"label":"mohsinulhaq:master","ref":"master","sha":"dbfaeb43087de656f285d3ecba18b9af530a85b8","user":{"login":"mohsinulhaq","id":7688231,"node_id":"MDQ6VXNlcjc2ODgyMzE=","avatar_url":"https://avatars1.githubusercontent.com/u/7688231?v=4","gravatar_id":"","url":"https://api.github.com/users/mohsinulhaq","html_url":"https://github.com/mohsinulhaq","followers_url":"https://api.github.com/users/mohsinulhaq/followers","following_url":"https://api.github.com/users/mohsinulhaq/following{/other_user}","gists_url":"https://api.github.com/users/mohsinulhaq/gists{/gist_id}","starred_url":"https://api.github.com/users/mohsinulhaq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mohsinulhaq/subscriptions","organizations_url":"https://api.github.com/users/mohsinulhaq/orgs","repos_url":"https://api.github.com/users/mohsinulhaq/repos","events_url":"https://api.github.com/users/mohsinulhaq/events{/privacy}","received_events_url":"https://api.github.com/users/mohsinulhaq/received_events","type":"User","site_admin":false},"repo":{"id":144013186,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQwMTMxODY=","name":"react-popper-tooltip","full_name":"mohsinulhaq/react-popper-tooltip","private":false,"owner":{"login":"mohsinulhaq","id":7688231,"node_id":"MDQ6VXNlcjc2ODgyMzE=","avatar_url":"https://avatars1.githubusercontent.com/u/7688231?v=4","gravatar_id":"","url":"https://api.github.com/users/mohsinulhaq","html_url":"https://github.com/mohsinulhaq","followers_url":"https://api.github.com/users/mohsinulhaq/followers","following_url":"https://api.github.com/users/mohsinulhaq/following{/other_user}","gists_url":"https://api.github.com/users/mohsinulhaq/gists{/gist_id}","starred_url":"https://api.github.com/users/mohsinulhaq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mohsinulhaq/subscriptions","organizations_url":"https://api.github.com/users/mohsinulhaq/orgs","repos_url":"https://api.github.com/users/mohsinulhaq/repos","events_url":"https://api.github.com/users/mohsinulhaq/events{/privacy}","received_events_url":"https://api.github.com/users/mohsinulhaq/received_events","type":"User","site_admin":false},"html_url":"https://github.com/mohsinulhaq/react-popper-tooltip","description":"React tooltip library built around react-popper","fork":false,"url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip","forks_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/forks","keys_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/teams","hooks_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/hooks","issue_events_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/issues/events{/number}","events_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/events","assignees_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/assignees{/user}","branches_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/branches{/branch}","tags_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/tags","blobs_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/git/refs{/sha}","trees_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/statuses/{sha}","languages_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/languages","stargazers_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/stargazers","contributors_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/contributors","subscribers_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/subscribers","subscription_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/subscription","commits_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/commits{/sha}","git_commits_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/git/commits{/sha}","comments_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/comments{/number}","issue_comment_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/issues/comments{/number}","contents_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/contents/{+path}","compare_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/merges","archive_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/downloads","issues_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/issues{/number}","pulls_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/pulls{/number}","milestones_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/milestones{/number}","notifications_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/labels{/name}","releases_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/releases{/id}","deployments_url":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/deployments","created_at":"2018-08-08T12:51:19Z","updated_at":"2018-09-19T11:27:50Z","pushed_at":"2018-09-19T12:42:03Z","git_url":"git://github.com/mohsinulhaq/react-popper-tooltip.git","ssh_url":"git@github.com:mohsinulhaq/react-popper-tooltip.git","clone_url":"https://github.com/mohsinulhaq/react-popper-tooltip.git","svn_url":"https://github.com/mohsinulhaq/react-popper-tooltip","homepage":"https://www.npmjs.com/package/react-popper-tooltip","size":143,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2,"open_issues":2,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/pulls/11"},"html":{"href":"https://github.com/mohsinulhaq/react-popper-tooltip/pull/11"},"issue":{"href":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/issues/11"},"comments":{"href":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/mohsinulhaq/react-popper-tooltip/statuses/f79b497cad4fc664e78aa6bb72b94c855d58be92"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"denisborovikov"}}