{"action":"created","issue":{"url":"https://api.github.com/repos/5calls/react-dev/issues/31","repository_url":"https://api.github.com/repos/5calls/react-dev","labels_url":"https://api.github.com/repos/5calls/react-dev/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/5calls/react-dev/issues/31/comments","events_url":"https://api.github.com/repos/5calls/react-dev/issues/31/events","html_url":"https://github.com/5calls/react-dev/pull/31","id":250354019,"number":31,"title":"Added a component for field office links","user":{"login":"nickoneill","id":49688,"avatar_url":"https://avatars3.githubusercontent.com/u/49688?v=4","gravatar_id":"","url":"https://api.github.com/users/nickoneill","html_url":"https://github.com/nickoneill","followers_url":"https://api.github.com/users/nickoneill/followers","following_url":"https://api.github.com/users/nickoneill/following{/other_user}","gists_url":"https://api.github.com/users/nickoneill/gists{/gist_id}","starred_url":"https://api.github.com/users/nickoneill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickoneill/subscriptions","organizations_url":"https://api.github.com/users/nickoneill/orgs","repos_url":"https://api.github.com/users/nickoneill/repos","events_url":"https://api.github.com/users/nickoneill/events{/privacy}","received_events_url":"https://api.github.com/users/nickoneill/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-08-15T15:43:46Z","updated_at":"2017-08-18T16:12:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/5calls/react-dev/pulls/31","html_url":"https://github.com/5calls/react-dev/pull/31","diff_url":"https://github.com/5calls/react-dev/pull/31.diff","patch_url":"https://github.com/5calls/react-dev/pull/31.patch"},"body":"My first React/Typescript PR! Working on #24. I don't fully understand everything yet so please let me know where I'm going in the wrong direction.\r\n\r\nExtracted this into its own component for local state. It's possible this could have been done in `ContactDetails` but I wanted to experiment with non-stateless components in fresh code.\r\n\r\nSome questions:\r\n* Should this be a single component by converting `ContactDetails` to `React.Component`?\r\n   @cdoremus **answer:** If you need to use a lifecycle method, have `ContactDetails` extend `React.Component`. If you feel you need to encapsulate logic in methods, you can create a stateless component class by extending `React.PureComponent<Props>`\r\n* `makePhoneLink` is now duplicated, it obviously should not be. If we're going with both components, how does one share this code between both?\r\n@cdoremus **answer:** Put `makePhoneLink` in a separate utility module in the `shared` folder that each  component imports and calls."},"comment":{"url":"https://api.github.com/repos/5calls/react-dev/issues/comments/323395954","html_url":"https://github.com/5calls/react-dev/pull/31#issuecomment-323395954","issue_url":"https://api.github.com/repos/5calls/react-dev/issues/31","id":323395954,"user":{"login":"nickoneill","id":49688,"avatar_url":"https://avatars3.githubusercontent.com/u/49688?v=4","gravatar_id":"","url":"https://api.github.com/users/nickoneill","html_url":"https://github.com/nickoneill","followers_url":"https://api.github.com/users/nickoneill/followers","following_url":"https://api.github.com/users/nickoneill/following{/other_user}","gists_url":"https://api.github.com/users/nickoneill/gists{/gist_id}","starred_url":"https://api.github.com/users/nickoneill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickoneill/subscriptions","organizations_url":"https://api.github.com/users/nickoneill/orgs","repos_url":"https://api.github.com/users/nickoneill/repos","events_url":"https://api.github.com/users/nickoneill/events{/privacy}","received_events_url":"https://api.github.com/users/nickoneill/received_events","type":"User","site_admin":false},"created_at":"2017-08-18T16:12:10Z","updated_at":"2017-08-18T16:12:10Z","body":"Perfect:\r\n\r\n> componentWillReceiveProps() is invoked before a mounted component receives new props. If you need to update the state in response to prop changes (for example, to reset it), you may compare this.props and nextProps and perform state transitions using this.setState() in this method."}}
{"actor":{"display_login":"nickoneill"}}