{"action":"created","issue":{"url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/1872","repository_url":"https://api.github.com/repos/yannickcr/eslint-plugin-react","labels_url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/1872/labels{/name}","comments_url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/1872/comments","events_url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/1872/events","html_url":"https://github.com/yannickcr/eslint-plugin-react/issues/1872","id":337525329,"node_id":"MDU6SXNzdWUzMzc1MjUzMjk=","number":1872,"title":"Apollo Query and Mutation components: JSX props should not use functions (react/jsx-no-bind)","user":{"login":"johnunclesam","id":21275217,"node_id":"MDQ6VXNlcjIxMjc1MjE3","avatar_url":"https://avatars3.githubusercontent.com/u/21275217?v=4","gravatar_id":"","url":"https://api.github.com/users/johnunclesam","html_url":"https://github.com/johnunclesam","followers_url":"https://api.github.com/users/johnunclesam/followers","following_url":"https://api.github.com/users/johnunclesam/following{/other_user}","gists_url":"https://api.github.com/users/johnunclesam/gists{/gist_id}","starred_url":"https://api.github.com/users/johnunclesam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnunclesam/subscriptions","organizations_url":"https://api.github.com/users/johnunclesam/orgs","repos_url":"https://api.github.com/users/johnunclesam/repos","events_url":"https://api.github.com/users/johnunclesam/events{/privacy}","received_events_url":"https://api.github.com/users/johnunclesam/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-07-02T13:45:00Z","updated_at":"2018-07-02T20:34:08Z","closed_at":"2018-07-02T20:03:01Z","author_association":"NONE","body":"I'm using the Apollo's `<Mutation>` component like this:\r\n\r\n```js\r\nimport gql from \"graphql-tag\";\r\nimport { Mutation } from \"react-apollo\";\r\n\r\nconst ADD_TODO = gql`\r\n  mutation addTodo($type: String!) {\r\n    addTodo(type: $type) {\r\n      id\r\n      type\r\n    }\r\n  }\r\n`;\r\n\r\nconst AddTodo = () => {\r\n  let input;\r\n\r\n  return (\r\n    <Mutation mutation={ADD_TODO}>\r\n      {(addTodo, { data }) => (\r\n        <div>\r\n          <form\r\n            onSubmit={e => {\r\n              e.preventDefault();\r\n              addTodo({ variables: { type: input.value } });\r\n              input.value = \"\";\r\n            }}\r\n          >\r\n            <input\r\n              ref={node => {\r\n                input = node;\r\n              }}\r\n            />\r\n            <button type=\"submit\">Add Todo</button>\r\n          </form>\r\n        </div>\r\n      )}\r\n    </Mutation>\r\n  );\r\n};\r\n```\r\n\r\nI get this error:\r\n\r\n`[eslint] JSX props should not use functions (react/jsx-no-bind)`\r\n\r\nI think it is complaining about:\r\n\r\n```js\r\nonSubmit={e => {\r\n  e.preventDefault();\r\n  addTodo({ variables: { type: input.value } });\r\n  input.value = \"\";\r\n}}\r\n```\r\n\r\nbecause is an arrow function.\r\n\r\nBut it's the default in Apollo React Docs: https://www.apollographql.com/docs/react/essentials/mutations.html.\r\n\r\nSo... it's a good way or we need a function in constructor?\r\n\r\nHow can I fix this and suggest it to Apollo React team?"},"comment":{"url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/comments/401925991","html_url":"https://github.com/yannickcr/eslint-plugin-react/issues/1872#issuecomment-401925991","issue_url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/1872","id":401925991,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTkyNTk5MQ==","user":{"login":"johnunclesam","id":21275217,"node_id":"MDQ6VXNlcjIxMjc1MjE3","avatar_url":"https://avatars3.githubusercontent.com/u/21275217?v=4","gravatar_id":"","url":"https://api.github.com/users/johnunclesam","html_url":"https://github.com/johnunclesam","followers_url":"https://api.github.com/users/johnunclesam/followers","following_url":"https://api.github.com/users/johnunclesam/following{/other_user}","gists_url":"https://api.github.com/users/johnunclesam/gists{/gist_id}","starred_url":"https://api.github.com/users/johnunclesam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnunclesam/subscriptions","organizations_url":"https://api.github.com/users/johnunclesam/orgs","repos_url":"https://api.github.com/users/johnunclesam/repos","events_url":"https://api.github.com/users/johnunclesam/events{/privacy}","received_events_url":"https://api.github.com/users/johnunclesam/received_events","type":"User","site_admin":false},"created_at":"2018-07-02T20:34:08Z","updated_at":"2018-07-02T20:34:08Z","author_association":"NONE","body":"Can you explain it better this phrase? Thanks.\r\n\r\n> In this case, it's on a DOM component, so it's fine."}}
{"actor":{"display_login":"johnunclesam"}}