{"action":"created","issue":{"url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/491","repository_url":"https://api.github.com/repos/yannickcr/eslint-plugin-react","labels_url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/491/labels{/name}","comments_url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/491/comments","events_url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/491/events","html_url":"https://github.com/yannickcr/eslint-plugin-react/issues/491","id":139235240,"number":491,"title":"react/prefer-stateless-function false positive","user":{"login":"jacobp100","id":7275322,"avatar_url":"https://avatars.githubusercontent.com/u/7275322?v=3","gravatar_id":"","url":"https://api.github.com/users/jacobp100","html_url":"https://github.com/jacobp100","followers_url":"https://api.github.com/users/jacobp100/followers","following_url":"https://api.github.com/users/jacobp100/following{/other_user}","gists_url":"https://api.github.com/users/jacobp100/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobp100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobp100/subscriptions","organizations_url":"https://api.github.com/users/jacobp100/orgs","repos_url":"https://api.github.com/users/jacobp100/repos","events_url":"https://api.github.com/users/jacobp100/events{/privacy}","received_events_url":"https://api.github.com/users/jacobp100/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2016-03-08T10:14:23Z","updated_at":"2016-03-15T10:14:51Z","closed_at":"2016-03-12T00:41:16Z","body":"Input\r\n\r\n```js\r\nclass Test extends React.Component {\r\n  constructor() {\r\n    super();\r\n    this.dispatchThingViaRedux = () => this.props.dispatch(thing());\r\n  }\r\n\r\n  render() {\r\n    return <button onClick={this.dispatchThingViaRedux}>Click me!</button>;\r\n  }\r\n}\r\n```\r\n\r\nThis gives a lint error to prefer a stateless function. However, in this case, it is not appropriate. While you could make a stateless function and just create a dispatch function every time, the value for the button onClick handler is changed between updates (i.e. `newProps.onClick. !== props.onClick`). Hence DOM updates have to occur if a stateless function was used."},"comment":{"url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/comments/196753996","html_url":"https://github.com/yannickcr/eslint-plugin-react/issues/491#issuecomment-196753996","issue_url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/491","id":196753996,"user":{"login":"Kerumen","id":5436545,"avatar_url":"https://avatars.githubusercontent.com/u/5436545?v=3","gravatar_id":"","url":"https://api.github.com/users/Kerumen","html_url":"https://github.com/Kerumen","followers_url":"https://api.github.com/users/Kerumen/followers","following_url":"https://api.github.com/users/Kerumen/following{/other_user}","gists_url":"https://api.github.com/users/Kerumen/gists{/gist_id}","starred_url":"https://api.github.com/users/Kerumen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kerumen/subscriptions","organizations_url":"https://api.github.com/users/Kerumen/orgs","repos_url":"https://api.github.com/users/Kerumen/repos","events_url":"https://api.github.com/users/Kerumen/events{/privacy}","received_events_url":"https://api.github.com/users/Kerumen/received_events","type":"User","site_admin":false},"created_at":"2016-03-15T10:14:51Z","updated_at":"2016-03-15T10:14:51Z","body":"Yep right! I always wrote the decorator so I forgot the good ol' syntax. Thanks :)"}}