{"action":"created","issue":{"url":"https://api.github.com/repos/mukeshsoni/react-telephone-input/issues/170","repository_url":"https://api.github.com/repos/mukeshsoni/react-telephone-input","labels_url":"https://api.github.com/repos/mukeshsoni/react-telephone-input/issues/170/labels{/name}","comments_url":"https://api.github.com/repos/mukeshsoni/react-telephone-input/issues/170/comments","events_url":"https://api.github.com/repos/mukeshsoni/react-telephone-input/issues/170/events","html_url":"https://github.com/mukeshsoni/react-telephone-input/pull/170","id":310756002,"number":170,"title":"Replace string ref usage with callback refs","user":{"login":"ablamunits","id":9403859,"avatar_url":"https://avatars2.githubusercontent.com/u/9403859?v=4","gravatar_id":"","url":"https://api.github.com/users/ablamunits","html_url":"https://github.com/ablamunits","followers_url":"https://api.github.com/users/ablamunits/followers","following_url":"https://api.github.com/users/ablamunits/following{/other_user}","gists_url":"https://api.github.com/users/ablamunits/gists{/gist_id}","starred_url":"https://api.github.com/users/ablamunits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ablamunits/subscriptions","organizations_url":"https://api.github.com/users/ablamunits/orgs","repos_url":"https://api.github.com/users/ablamunits/repos","events_url":"https://api.github.com/users/ablamunits/events{/privacy}","received_events_url":"https://api.github.com/users/ablamunits/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-03T09:17:28Z","updated_at":"2018-05-09T04:28:21Z","closed_at":"2018-05-09T04:28:21Z","author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/mukeshsoni/react-telephone-input/pulls/170","html_url":"https://github.com/mukeshsoni/react-telephone-input/pull/170","diff_url":"https://github.com/mukeshsoni/react-telephone-input/pull/170.diff","patch_url":"https://github.com/mukeshsoni/react-telephone-input/pull/170.patch"},"body":"Hi,\r\n\r\nSetting element `ref`s using \"String Refs\" is considered [legacy API](https://reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs) by React and is generally discouraged due to [certain issues](https://github.com/facebook/react/pull/8333#issuecomment-271648615).\r\n\r\nWe personally ran into issues in our own setup, where the usage of string refs caused the following error to appear when `ReactTelephoneInput` was mounted in a our larger application, bundled with browserfiy:\r\n\r\n```\r\nremoveComponentAsRefFrom(...): Only a ReactOwner can have refs. You might be removing a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).\r\n```\r\n\r\nI did not dig any deeper into the exact root cause of this, and perhaps this has something to do with the structure of our project. However, using callback refs in telephone input has solved the issue for us and it seems to be a reasonable solution, considering the currently used API will be deprecated at some point.\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/mukeshsoni/react-telephone-input/issues/comments/387616528","html_url":"https://github.com/mukeshsoni/react-telephone-input/pull/170#issuecomment-387616528","issue_url":"https://api.github.com/repos/mukeshsoni/react-telephone-input/issues/170","id":387616528,"user":{"login":"mukeshsoni","id":1042954,"avatar_url":"https://avatars2.githubusercontent.com/u/1042954?v=4","gravatar_id":"","url":"https://api.github.com/users/mukeshsoni","html_url":"https://github.com/mukeshsoni","followers_url":"https://api.github.com/users/mukeshsoni/followers","following_url":"https://api.github.com/users/mukeshsoni/following{/other_user}","gists_url":"https://api.github.com/users/mukeshsoni/gists{/gist_id}","starred_url":"https://api.github.com/users/mukeshsoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mukeshsoni/subscriptions","organizations_url":"https://api.github.com/users/mukeshsoni/orgs","repos_url":"https://api.github.com/users/mukeshsoni/repos","events_url":"https://api.github.com/users/mukeshsoni/events{/privacy}","received_events_url":"https://api.github.com/users/mukeshsoni/received_events","type":"User","site_admin":false},"created_at":"2018-05-09T04:28:21Z","updated_at":"2018-05-09T04:28:21Z","author_association":"OWNER","body":"@ablamunits I have completely removed the dependency on `react-dom` and also removed all the refs on all the list items. Have switched to using `react-tiny-virtual-list`, which implements windowing on the list and hence is much more performant. Win-win."}}
{"actor":{"display_login":"mukeshsoni"}}