{"action":"closed","issue":{"url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/532","repository_url":"https://api.github.com/repos/yannickcr/eslint-plugin-react","labels_url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/532/labels{/name}","comments_url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/532/comments","events_url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/532/events","html_url":"https://github.com/yannickcr/eslint-plugin-react/issues/532","id":146558954,"number":532,"title":"Detect \"function-bind\" new syntax in jsx-no-bind","user":{"login":"feugy","id":186268,"avatar_url":"https://avatars.githubusercontent.com/u/186268?v=3","gravatar_id":"","url":"https://api.github.com/users/feugy","html_url":"https://github.com/feugy","followers_url":"https://api.github.com/users/feugy/followers","following_url":"https://api.github.com/users/feugy/following{/other_user}","gists_url":"https://api.github.com/users/feugy/gists{/gist_id}","starred_url":"https://api.github.com/users/feugy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feugy/subscriptions","organizations_url":"https://api.github.com/users/feugy/orgs","repos_url":"https://api.github.com/users/feugy/repos","events_url":"https://api.github.com/users/feugy/events{/privacy}","received_events_url":"https://api.github.com/users/feugy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-07T09:24:04Z","updated_at":"2016-06-19T19:00:37Z","closed_at":"2016-06-19T19:00:37Z","body":"Babel stage-0 implement the [\"function-bind\"](http://babeljs.io/blog/2015/05/14/function-bind) proposal.\r\nThis new syntax offers a `::` suffix operator to make autobind:\r\n\r\n```javascript\r\nimport React, { Component, PropTypes } from 'react'\r\n\r\nexport default class Example extends Component {\r\n\r\n  state = {\r\n    value: 'hi'\r\n  }\r\n\r\n  onInputChange = () => {\r\n    this.setState({\r\n      value: this.refs.value.getValue()\r\n    })\r\n  }\r\n\r\n  render () {\r\n    return (\r\n      <input\r\n        type=\"text\"\r\n        ref=\"value\"\r\n        value={this.state.value}\r\n        onChange={::this.onInputChange}/>\r\n    )\r\n  }\r\n}\r\n```\r\n\r\nThis syntax is handy for React applications, as an alternative to [class properties](https://github.com/jeffmo/es-class-fields-and-static-properties#part-1-class-instance-fields).\r\n\r\nBut unfortunately, it uses bind (see [babel's ouput](http://babeljs.io/repl/#?evaluate=false&presets=es2015%2Creact%2Cstage-0%2Cstage-2&experimental=true&loose=false&spec=false&playground=false&code=import%20React%2C%20{%20Component%2C%20PropTypes%20}%20from%20%27react%27%0A%0Aexport%20default%20class%20Example%20extends%20Component%20{%0A%0A%20%20state%20%3D%20{%0A%20%20%20%20value%3A%20%27hi%27%0A%20%20}%0A%0A%20%20onInputChange%20%3D%20%28%29%20%3D%3E%20{%0A%20%20%20%20this.setState%28{%0A%20%20%20%20%20%20value%3A%20this.refs.value.getValue%28%29%0A%20%20%20%20}%29%0A%20%20}%0A%0A%20%20render%20%28%29%20{%0A%20%20%20%20return%20%28%0A%20%20%20%20%20%20%3Cinput%0A%20%20%20%20%20%20%20%20type%3D%22text%22%0A%20%20%20%20%20%20%20%20ref%3D%22value%22%0A%20%20%20%20%20%20%20%20value%3D{this.state.value}%0A%20%20%20%20%20%20%20%20onChange%3D{%3A%3Athis.onInputChange}%2F%3E%0A%20%20%20%20%29%0A%20%20}%0A}%0A)) and lead to the same performance issues as fat arrows and bind explicit call."}}
{"actor":{"display_login":"yannickcr"}}