{"action":"created","issue":{"url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/2925","repository_url":"https://api.github.com/repos/facebookincubator/create-react-app","labels_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/2925/labels{/name}","comments_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/2925/comments","events_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/2925/events","html_url":"https://github.com/facebookincubator/create-react-app/issues/2925","id":248920047,"number":2925,"title":"Usage of property initializer syntax throws no-invalid-this eslint error","user":{"login":"duro","id":17632,"avatar_url":"https://avatars0.githubusercontent.com/u/17632?v=4","gravatar_id":"","url":"https://api.github.com/users/duro","html_url":"https://github.com/duro","followers_url":"https://api.github.com/users/duro/followers","following_url":"https://api.github.com/users/duro/following{/other_user}","gists_url":"https://api.github.com/users/duro/gists{/gist_id}","starred_url":"https://api.github.com/users/duro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duro/subscriptions","organizations_url":"https://api.github.com/users/duro/orgs","repos_url":"https://api.github.com/users/duro/repos","events_url":"https://api.github.com/users/duro/events{/privacy}","received_events_url":"https://api.github.com/users/duro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-09T05:24:45Z","updated_at":"2017-08-09T12:59:30Z","closed_at":null,"body":"When I use \"property initializer syntax\" to define my event handlers per the React docs (https://facebook.github.io/react/docs/handling-events.html) and do a `this.setState` inside the handle, I get eslint throwing a `no-invalid-this` error.\r\n\r\nI don't think this is a bug in create-react-app, but perhaps something that has not been worked into babel-eslint or eslint-plugin-babel (See: https://github.com/babel/babel-eslint/issues/401#issuecomment-253099182)\r\n\r\nHas a workaround to this be found?"},"comment":{"url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/comments/321247776","html_url":"https://github.com/facebookincubator/create-react-app/issues/2925#issuecomment-321247776","issue_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/2925","id":321247776,"user":{"login":"Timer","id":616428,"avatar_url":"https://avatars1.githubusercontent.com/u/616428?v=4","gravatar_id":"","url":"https://api.github.com/users/Timer","html_url":"https://github.com/Timer","followers_url":"https://api.github.com/users/Timer/followers","following_url":"https://api.github.com/users/Timer/following{/other_user}","gists_url":"https://api.github.com/users/Timer/gists{/gist_id}","starred_url":"https://api.github.com/users/Timer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Timer/subscriptions","organizations_url":"https://api.github.com/users/Timer/orgs","repos_url":"https://api.github.com/users/Timer/repos","events_url":"https://api.github.com/users/Timer/events{/privacy}","received_events_url":"https://api.github.com/users/Timer/received_events","type":"User","site_admin":false},"created_at":"2017-08-09T12:59:30Z","updated_at":"2017-08-09T12:59:30Z","body":"The following works for me:\r\n```js\r\nimport React, { Component } from 'react';\r\nimport logo from './logo.svg';\r\nimport './App.css';\r\n\r\nclass App extends Component {\r\n  click = () => {\r\n    console.log('yas')\r\n  }\r\n\r\n  render() {\r\n    return (\r\n      <div className=\"App\">\r\n        <div className=\"App-header\">\r\n          <img src={logo} className=\"App-logo\" alt=\"logo\" />\r\n          <h2 onClick={this.click}>Welcome to React</h2>\r\n        </div>\r\n        <p className=\"App-intro\">\r\n          To get started, edit <code>src/App.js</code> and save to reload.\r\n        </p>\r\n      </div>\r\n    );\r\n  }\r\n}\r\n\r\nexport default App;\r\n```"}}
{"actor":{"display_login":"Timer"}}