{"action":"opened","issue":{"url":"https://api.github.com/repos/krizzc/bwa-u3-jammming-prj/issues/4","repository_url":"https://api.github.com/repos/krizzc/bwa-u3-jammming-prj","labels_url":"https://api.github.com/repos/krizzc/bwa-u3-jammming-prj/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/krizzc/bwa-u3-jammming-prj/issues/4/comments","events_url":"https://api.github.com/repos/krizzc/bwa-u3-jammming-prj/issues/4/events","html_url":"https://github.com/krizzc/bwa-u3-jammming-prj/issues/4","id":332250776,"node_id":"MDU6SXNzdWUzMzIyNTA3NzY=","number":4,"title":"Track Component Review","user":{"login":"jordanwillis","id":7652259,"node_id":"MDQ6VXNlcjc2NTIyNTk=","avatar_url":"https://avatars2.githubusercontent.com/u/7652259?v=4","gravatar_id":"","url":"https://api.github.com/users/jordanwillis","html_url":"https://github.com/jordanwillis","followers_url":"https://api.github.com/users/jordanwillis/followers","following_url":"https://api.github.com/users/jordanwillis/following{/other_user}","gists_url":"https://api.github.com/users/jordanwillis/gists{/gist_id}","starred_url":"https://api.github.com/users/jordanwillis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordanwillis/subscriptions","organizations_url":"https://api.github.com/users/jordanwillis/orgs","repos_url":"https://api.github.com/users/jordanwillis/repos","events_url":"https://api.github.com/users/jordanwillis/events{/privacy}","received_events_url":"https://api.github.com/users/jordanwillis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-14T04:51:13Z","updated_at":"2018-06-14T04:51:13Z","closed_at":null,"author_association":"NONE","body":"Just as a quick JavaScript tip, you might want to consider using an alternate `renderAction()` implementation.\r\n\r\nhttps://github.com/krizzc/bwa-u3-jammming-prj/blob/e0a3b9611e0f77583207c9f0043c49c84aff87c6/src/Components/Track/Track.js#L12-L19\r\n\r\nThe way you have it works perfectly fine and it's nice that the function only includes a single `return` statement due to the object key lookup.  However coupling the ternary logic in the return statement to the object key names earlier in the function ends up being quite brittle.  For example, what happens if you (or a team mate if this were a real life project with several people) decides to change the name of one of the keys or perhaps you later decide to add an additional action to the page.  In both of these cases you will have to remember to also update your return statement logic, which could easily be forgotten.\r\n\r\nI would recommend a more straight foreword approach just to prevent any headaches for the future.\r\n\r\n``` javascript\r\nrenderAction() {\r\n  if (this.props.isRemoval) {\r\n    return <a className=\"Track-action\" onClick={this.removeTrack}>-</a>\r\n  }\r\n  return <a className=\"Track-action\" onClick={this.addTrack}>+</a>;\r\n}\r\n```"}}
{"actor":{"display_login":"jordanwillis"}}