{"action":"created","issue":{"url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/issues/84","repository_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform","labels_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/issues/84/comments","events_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/issues/84/events","html_url":"https://github.com/gaearon/babel-plugin-react-transform/issues/84","id":133792002,"number":84,"title":"Appears to wrap other functions than createClass()","user":{"login":"gaearon","id":810438,"avatar_url":"https://avatars.githubusercontent.com/u/810438?v=3","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-02-15T18:58:58Z","updated_at":"2016-02-18T20:21:00Z","closed_at":null,"body":"As reported in https://github.com/gaearon/react-transform-catch-errors/issues/25, it seems that the plugin regressed in 2.x and thinks `React.shape` is something like `React.createClass` just because it receives an object as the argument."},"comment":{"url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/issues/comments/185898024","html_url":"https://github.com/gaearon/babel-plugin-react-transform/issues/84#issuecomment-185898024","issue_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/issues/84","id":185898024,"user":{"login":"nfcampos","id":56902,"avatar_url":"https://avatars.githubusercontent.com/u/56902?v=3","gravatar_id":"","url":"https://api.github.com/users/nfcampos","html_url":"https://github.com/nfcampos","followers_url":"https://api.github.com/users/nfcampos/followers","following_url":"https://api.github.com/users/nfcampos/following{/other_user}","gists_url":"https://api.github.com/users/nfcampos/gists{/gist_id}","starred_url":"https://api.github.com/users/nfcampos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfcampos/subscriptions","organizations_url":"https://api.github.com/users/nfcampos/orgs","repos_url":"https://api.github.com/users/nfcampos/repos","events_url":"https://api.github.com/users/nfcampos/events{/privacy}","received_events_url":"https://api.github.com/users/nfcampos/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T20:21:00Z","updated_at":"2016-02-18T20:21:00Z","body":"the goal:\r\n```js\r\nif (shouldNotWrap)\r\n  return\r\nelse\r\n  wrap()\r\n```\r\na) current implementation:\r\n```js\r\nif (doesntExtendSuperClass && doesntHaveRenderMethod)\r\n  return\r\nelse\r\n  wrap()\r\n// !(doesntExtendSuperClass && doesntHaveRenderMethod) === (extendsSuperClass || hasRenderMethod)\r\n```\r\nb) change to `||`:\r\n```js\r\nif (doesntExtendSuperClass || doesntHaveRenderMethod)\r\n  return\r\nelse\r\n  wrap()\r\n// !(doesntExtendSuperClass || doesntHaveRenderMethod) === (extendsSuperClass && hasRenderMethod)\r\n// so this would only wrap descendants of the super class that have a render method\r\n// which makes all the current tests (but one) fail\r\n// but is maybe what we want actually, seeing as the render() method is required in react classes (see https://facebook.github.io/react/docs/component-specs.html#render\r\n```\r\nc) remove the render method check:\r\n```js\r\nif (doesntExtendSuperClass)\r\n  return\r\nelse\r\n  wrap()\r\n// !(doesntExtendSuperClass) === (extendsSuperClass)\r\n// so this would wrap all classes that are descendants of the super class\r\n// which fails only 2 of the current tests (the 2 tests that are expecting the wrong thing)\r\n```\r\nso which one do we want? (b) or (c)?"}}