{"action":"opened","number":92,"pull_request":{"url":"https://api.github.com/repos/souporserious/react-popper/pulls/92","id":168164709,"html_url":"https://github.com/souporserious/react-popper/pull/92","diff_url":"https://github.com/souporserious/react-popper/pull/92.diff","patch_url":"https://github.com/souporserious/react-popper/pull/92.patch","issue_url":"https://api.github.com/repos/souporserious/react-popper/issues/92","number":92,"state":"open","locked":false,"title":"Pass target directly to popper","user":{"login":"Gudahtt","id":2459287,"avatar_url":"https://avatars0.githubusercontent.com/u/2459287?v=4","gravatar_id":"","url":"https://api.github.com/users/Gudahtt","html_url":"https://github.com/Gudahtt","followers_url":"https://api.github.com/users/Gudahtt/followers","following_url":"https://api.github.com/users/Gudahtt/following{/other_user}","gists_url":"https://api.github.com/users/Gudahtt/gists{/gist_id}","starred_url":"https://api.github.com/users/Gudahtt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gudahtt/subscriptions","organizations_url":"https://api.github.com/users/Gudahtt/orgs","repos_url":"https://api.github.com/users/Gudahtt/repos","events_url":"https://api.github.com/users/Gudahtt/events{/privacy}","received_events_url":"https://api.github.com/users/Gudahtt/received_events","type":"User","site_admin":false},"body":"Allows passing in a `target` prop to the Popper component directly, bypassing the need for the `Manager` and `Target` components. I implemented this feature for personal use initially, as it was needed in the development of a custom UI library.\r\n\r\nThe documentation and examples have been updated. I did try to make clear that the `Manager` and `Target` pattern is recommended and easier to use, and should be preferred in most cases.\r\n\r\nIt was challenging to think of a good example for this feature. I saw two options; get a `ref` and use that, or get an element directly from the DOM. I didn't want to do the latter, because it's generally recommended to avoid that when using React. But the `ref` was problematic as well. If I just grabbed a ref and used it right away, the resulting component would fail to pass in a `target` prop on the first render, because the ref doesn't get called assigned until after the child component mounts. I considered briefly just using `forceUpdate` to trigger a second render in `componentDidMount`, but that was too complex.\r\n\r\nInstead, I side-stepped the issue by writing an example that defaulted to not showing the popper component at all. That avoids the ref issue, because the popper is always hidden on first render, so it doesn't need to be shown. However, this gave me another concern - that people would look at the README for a quick example of how to make an open/close-able popover and grab that example without considering whether using `Manager` would suit their use case better. So to avoid that circumstance, I also added an example doing the same thing with `Manager` and `Target` first.\r\n\r\nI'm not sure how it turned out. Maybe four usage examples is too many. But I think that this API change is significant enough that it should have a usage documented, and I don't want to lead people into the trap of using this pattern when they shouldn't. Thoughts?","created_at":"2018-02-09T06:42:12Z","updated_at":"2018-02-09T06:42:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/souporserious/react-popper/pulls/92/commits","review_comments_url":"https://api.github.com/repos/souporserious/react-popper/pulls/92/comments","review_comment_url":"https://api.github.com/repos/souporserious/react-popper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/souporserious/react-popper/issues/92/comments","statuses_url":"https://api.github.com/repos/souporserious/react-popper/statuses/415c1f33a644cd667ac24245063d35a6ec73f367","head":{"label":"Gudahtt:pass-target-directly-to-popper","ref":"pass-target-directly-to-popper","sha":"415c1f33a644cd667ac24245063d35a6ec73f367","user":{"login":"Gudahtt","id":2459287,"avatar_url":"https://avatars0.githubusercontent.com/u/2459287?v=4","gravatar_id":"","url":"https://api.github.com/users/Gudahtt","html_url":"https://github.com/Gudahtt","followers_url":"https://api.github.com/users/Gudahtt/followers","following_url":"https://api.github.com/users/Gudahtt/following{/other_user}","gists_url":"https://api.github.com/users/Gudahtt/gists{/gist_id}","starred_url":"https://api.github.com/users/Gudahtt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gudahtt/subscriptions","organizations_url":"https://api.github.com/users/Gudahtt/orgs","repos_url":"https://api.github.com/users/Gudahtt/repos","events_url":"https://api.github.com/users/Gudahtt/events{/privacy}","received_events_url":"https://api.github.com/users/Gudahtt/received_events","type":"User","site_admin":false},"repo":{"id":113614112,"name":"react-popper","full_name":"Gudahtt/react-popper","owner":{"login":"Gudahtt","id":2459287,"avatar_url":"https://avatars0.githubusercontent.com/u/2459287?v=4","gravatar_id":"","url":"https://api.github.com/users/Gudahtt","html_url":"https://github.com/Gudahtt","followers_url":"https://api.github.com/users/Gudahtt/followers","following_url":"https://api.github.com/users/Gudahtt/following{/other_user}","gists_url":"https://api.github.com/users/Gudahtt/gists{/gist_id}","starred_url":"https://api.github.com/users/Gudahtt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gudahtt/subscriptions","organizations_url":"https://api.github.com/users/Gudahtt/orgs","repos_url":"https://api.github.com/users/Gudahtt/repos","events_url":"https://api.github.com/users/Gudahtt/events{/privacy}","received_events_url":"https://api.github.com/users/Gudahtt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Gudahtt/react-popper","description":"React wrapper around PopperJS","fork":true,"url":"https://api.github.com/repos/Gudahtt/react-popper","forks_url":"https://api.github.com/repos/Gudahtt/react-popper/forks","keys_url":"https://api.github.com/repos/Gudahtt/react-popper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gudahtt/react-popper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gudahtt/react-popper/teams","hooks_url":"https://api.github.com/repos/Gudahtt/react-popper/hooks","issue_events_url":"https://api.github.com/repos/Gudahtt/react-popper/issues/events{/number}","events_url":"https://api.github.com/repos/Gudahtt/react-popper/events","assignees_url":"https://api.github.com/repos/Gudahtt/react-popper/assignees{/user}","branches_url":"https://api.github.com/repos/Gudahtt/react-popper/branches{/branch}","tags_url":"https://api.github.com/repos/Gudahtt/react-popper/tags","blobs_url":"https://api.github.com/repos/Gudahtt/react-popper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gudahtt/react-popper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gudahtt/react-popper/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gudahtt/react-popper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gudahtt/react-popper/statuses/{sha}","languages_url":"https://api.github.com/repos/Gudahtt/react-popper/languages","stargazers_url":"https://api.github.com/repos/Gudahtt/react-popper/stargazers","contributors_url":"https://api.github.com/repos/Gudahtt/react-popper/contributors","subscribers_url":"https://api.github.com/repos/Gudahtt/react-popper/subscribers","subscription_url":"https://api.github.com/repos/Gudahtt/react-popper/subscription","commits_url":"https://api.github.com/repos/Gudahtt/react-popper/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gudahtt/react-popper/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gudahtt/react-popper/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gudahtt/react-popper/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gudahtt/react-popper/contents/{+path}","compare_url":"https://api.github.com/repos/Gudahtt/react-popper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gudahtt/react-popper/merges","archive_url":"https://api.github.com/repos/Gudahtt/react-popper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gudahtt/react-popper/downloads","issues_url":"https://api.github.com/repos/Gudahtt/react-popper/issues{/number}","pulls_url":"https://api.github.com/repos/Gudahtt/react-popper/pulls{/number}","milestones_url":"https://api.github.com/repos/Gudahtt/react-popper/milestones{/number}","notifications_url":"https://api.github.com/repos/Gudahtt/react-popper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gudahtt/react-popper/labels{/name}","releases_url":"https://api.github.com/repos/Gudahtt/react-popper/releases{/id}","deployments_url":"https://api.github.com/repos/Gudahtt/react-popper/deployments","created_at":"2017-12-08T20:23:44Z","updated_at":"2017-12-08T20:23:47Z","pushed_at":"2018-02-09T06:29:29Z","git_url":"git://github.com/Gudahtt/react-popper.git","ssh_url":"git@github.com:Gudahtt/react-popper.git","clone_url":"https://github.com/Gudahtt/react-popper.git","svn_url":"https://github.com/Gudahtt/react-popper","homepage":null,"size":229,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"souporserious:master","ref":"master","sha":"c1883b13ea6051726503e9032a4224ba00d6db87","user":{"login":"souporserious","id":2762082,"avatar_url":"https://avatars1.githubusercontent.com/u/2762082?v=4","gravatar_id":"","url":"https://api.github.com/users/souporserious","html_url":"https://github.com/souporserious","followers_url":"https://api.github.com/users/souporserious/followers","following_url":"https://api.github.com/users/souporserious/following{/other_user}","gists_url":"https://api.github.com/users/souporserious/gists{/gist_id}","starred_url":"https://api.github.com/users/souporserious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/souporserious/subscriptions","organizations_url":"https://api.github.com/users/souporserious/orgs","repos_url":"https://api.github.com/users/souporserious/repos","events_url":"https://api.github.com/users/souporserious/events{/privacy}","received_events_url":"https://api.github.com/users/souporserious/received_events","type":"User","site_admin":false},"repo":{"id":70210509,"name":"react-popper","full_name":"souporserious/react-popper","owner":{"login":"souporserious","id":2762082,"avatar_url":"https://avatars1.githubusercontent.com/u/2762082?v=4","gravatar_id":"","url":"https://api.github.com/users/souporserious","html_url":"https://github.com/souporserious","followers_url":"https://api.github.com/users/souporserious/followers","following_url":"https://api.github.com/users/souporserious/following{/other_user}","gists_url":"https://api.github.com/users/souporserious/gists{/gist_id}","starred_url":"https://api.github.com/users/souporserious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/souporserious/subscriptions","organizations_url":"https://api.github.com/users/souporserious/orgs","repos_url":"https://api.github.com/users/souporserious/repos","events_url":"https://api.github.com/users/souporserious/events{/privacy}","received_events_url":"https://api.github.com/users/souporserious/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/souporserious/react-popper","description":"React wrapper around PopperJS","fork":false,"url":"https://api.github.com/repos/souporserious/react-popper","forks_url":"https://api.github.com/repos/souporserious/react-popper/forks","keys_url":"https://api.github.com/repos/souporserious/react-popper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/souporserious/react-popper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/souporserious/react-popper/teams","hooks_url":"https://api.github.com/repos/souporserious/react-popper/hooks","issue_events_url":"https://api.github.com/repos/souporserious/react-popper/issues/events{/number}","events_url":"https://api.github.com/repos/souporserious/react-popper/events","assignees_url":"https://api.github.com/repos/souporserious/react-popper/assignees{/user}","branches_url":"https://api.github.com/repos/souporserious/react-popper/branches{/branch}","tags_url":"https://api.github.com/repos/souporserious/react-popper/tags","blobs_url":"https://api.github.com/repos/souporserious/react-popper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/souporserious/react-popper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/souporserious/react-popper/git/refs{/sha}","trees_url":"https://api.github.com/repos/souporserious/react-popper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/souporserious/react-popper/statuses/{sha}","languages_url":"https://api.github.com/repos/souporserious/react-popper/languages","stargazers_url":"https://api.github.com/repos/souporserious/react-popper/stargazers","contributors_url":"https://api.github.com/repos/souporserious/react-popper/contributors","subscribers_url":"https://api.github.com/repos/souporserious/react-popper/subscribers","subscription_url":"https://api.github.com/repos/souporserious/react-popper/subscription","commits_url":"https://api.github.com/repos/souporserious/react-popper/commits{/sha}","git_commits_url":"https://api.github.com/repos/souporserious/react-popper/git/commits{/sha}","comments_url":"https://api.github.com/repos/souporserious/react-popper/comments{/number}","issue_comment_url":"https://api.github.com/repos/souporserious/react-popper/issues/comments{/number}","contents_url":"https://api.github.com/repos/souporserious/react-popper/contents/{+path}","compare_url":"https://api.github.com/repos/souporserious/react-popper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/souporserious/react-popper/merges","archive_url":"https://api.github.com/repos/souporserious/react-popper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/souporserious/react-popper/downloads","issues_url":"https://api.github.com/repos/souporserious/react-popper/issues{/number}","pulls_url":"https://api.github.com/repos/souporserious/react-popper/pulls{/number}","milestones_url":"https://api.github.com/repos/souporserious/react-popper/milestones{/number}","notifications_url":"https://api.github.com/repos/souporserious/react-popper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/souporserious/react-popper/labels{/name}","releases_url":"https://api.github.com/repos/souporserious/react-popper/releases{/id}","deployments_url":"https://api.github.com/repos/souporserious/react-popper/deployments","created_at":"2016-10-07T02:51:11Z","updated_at":"2018-02-09T06:10:16Z","pushed_at":"2018-02-07T10:41:13Z","git_url":"git://github.com/souporserious/react-popper.git","ssh_url":"git@github.com:souporserious/react-popper.git","clone_url":"https://github.com/souporserious/react-popper.git","svn_url":"https://github.com/souporserious/react-popper","homepage":null,"size":285,"stargazers_count":463,"watchers_count":463,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":54,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":54,"open_issues":12,"watchers":463,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/souporserious/react-popper/pulls/92"},"html":{"href":"https://github.com/souporserious/react-popper/pull/92"},"issue":{"href":"https://api.github.com/repos/souporserious/react-popper/issues/92"},"comments":{"href":"https://api.github.com/repos/souporserious/react-popper/issues/92/comments"},"review_comments":{"href":"https://api.github.com/repos/souporserious/react-popper/pulls/92/comments"},"review_comment":{"href":"https://api.github.com/repos/souporserious/react-popper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/souporserious/react-popper/pulls/92/commits"},"statuses":{"href":"https://api.github.com/repos/souporserious/react-popper/statuses/415c1f33a644cd667ac24245063d35a6ec73f367"}},"author_association":"NONE","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":3,"additions":174,"deletions":3,"changed_files":5}}
{"actor":{"display_login":"Gudahtt"}}