{"action":"created","comment":{"url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/pulls/comments/41297529","id":41297529,"diff_hunk":"@@ -88,13 +89,19 @@ export default function ({ Plugin, types: t }) {\n   }\n \n   /**\n-   * Infers a displayName from either a class node, or a createClass() call node.\n+   * Infers a displayName from either a class node, createClass() call, or a stateless component variable declaration\n    */\n-  function findDisplayName(node) {\n+  function findDisplayName(node, parent) {\n     if (node.id) {\n       return node.id.name;\n     }\n+\n     if (!node.arguments) {\n+      // likely stateless function component. Check if assigned to a variable","path":"src/index.js","position":22,"original_position":22,"commit_id":"eb8d1bf75f39c9113e289fe2fe7fcb8f9efdc7c6","original_commit_id":"eb8d1bf75f39c9113e289fe2fe7fcb8f9efdc7c6","user":{"login":"iamdustan","id":227879,"avatar_url":"https://avatars.githubusercontent.com/u/227879?v=3","gravatar_id":"","url":"https://api.github.com/users/iamdustan","html_url":"https://github.com/iamdustan","followers_url":"https://api.github.com/users/iamdustan/followers","following_url":"https://api.github.com/users/iamdustan/following{/other_user}","gists_url":"https://api.github.com/users/iamdustan/gists{/gist_id}","starred_url":"https://api.github.com/users/iamdustan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamdustan/subscriptions","organizations_url":"https://api.github.com/users/iamdustan/orgs","repos_url":"https://api.github.com/users/iamdustan/repos","events_url":"https://api.github.com/users/iamdustan/events{/privacy}","received_events_url":"https://api.github.com/users/iamdustan/received_events","type":"User","site_admin":false},"body":"threading the `parent` node through to here so that the following example resolves a displayName of `MyComponent`\r\n\r\n```\r\nconst MyComponent = (props) => <div />\r\n```","created_at":"2015-10-06T17:48:10Z","updated_at":"2015-10-06T17:48:10Z","html_url":"https://github.com/gaearon/babel-plugin-react-transform/pull/36#discussion_r41297529","pull_request_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/pulls/comments/41297529"},"html":{"href":"https://github.com/gaearon/babel-plugin-react-transform/pull/36#discussion_r41297529"},"pull_request":{"href":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/pulls/36","id":46934175,"html_url":"https://github.com/gaearon/babel-plugin-react-transform/pull/36","diff_url":"https://github.com/gaearon/babel-plugin-react-transform/pull/36.diff","patch_url":"https://github.com/gaearon/babel-plugin-react-transform/pull/36.patch","issue_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/issues/36","number":36,"state":"open","locked":false,"title":"Stateless components","user":{"login":"iamdustan","id":227879,"avatar_url":"https://avatars.githubusercontent.com/u/227879?v=3","gravatar_id":"","url":"https://api.github.com/users/iamdustan","html_url":"https://github.com/iamdustan","followers_url":"https://api.github.com/users/iamdustan/followers","following_url":"https://api.github.com/users/iamdustan/following{/other_user}","gists_url":"https://api.github.com/users/iamdustan/gists{/gist_id}","starred_url":"https://api.github.com/users/iamdustan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamdustan/subscriptions","organizations_url":"https://api.github.com/users/iamdustan/orgs","repos_url":"https://api.github.com/users/iamdustan/repos","events_url":"https://api.github.com/users/iamdustan/events{/privacy}","received_events_url":"https://api.github.com/users/iamdustan/received_events","type":"User","site_admin":false},"body":"Detect and wrap stateless function components.","created_at":"2015-10-06T17:43:54Z","updated_at":"2015-10-06T17:48:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f21791691b4618757c7e1bdf9651a082621a2b7d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/pulls/36/commits","review_comments_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/pulls/36/comments","review_comment_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/issues/36/comments","statuses_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/statuses/eb8d1bf75f39c9113e289fe2fe7fcb8f9efdc7c6","head":{"label":"iamdustan:stateless-components","ref":"stateless-components","sha":"eb8d1bf75f39c9113e289fe2fe7fcb8f9efdc7c6","user":{"login":"iamdustan","id":227879,"avatar_url":"https://avatars.githubusercontent.com/u/227879?v=3","gravatar_id":"","url":"https://api.github.com/users/iamdustan","html_url":"https://github.com/iamdustan","followers_url":"https://api.github.com/users/iamdustan/followers","following_url":"https://api.github.com/users/iamdustan/following{/other_user}","gists_url":"https://api.github.com/users/iamdustan/gists{/gist_id}","starred_url":"https://api.github.com/users/iamdustan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamdustan/subscriptions","organizations_url":"https://api.github.com/users/iamdustan/orgs","repos_url":"https://api.github.com/users/iamdustan/repos","events_url":"https://api.github.com/users/iamdustan/events{/privacy}","received_events_url":"https://api.github.com/users/iamdustan/received_events","type":"User","site_admin":false},"repo":{"id":43756475,"name":"babel-plugin-react-transform","full_name":"iamdustan/babel-plugin-react-transform","owner":{"login":"iamdustan","id":227879,"avatar_url":"https://avatars.githubusercontent.com/u/227879?v=3","gravatar_id":"","url":"https://api.github.com/users/iamdustan","html_url":"https://github.com/iamdustan","followers_url":"https://api.github.com/users/iamdustan/followers","following_url":"https://api.github.com/users/iamdustan/following{/other_user}","gists_url":"https://api.github.com/users/iamdustan/gists{/gist_id}","starred_url":"https://api.github.com/users/iamdustan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamdustan/subscriptions","organizations_url":"https://api.github.com/users/iamdustan/orgs","repos_url":"https://api.github.com/users/iamdustan/repos","events_url":"https://api.github.com/users/iamdustan/events{/privacy}","received_events_url":"https://api.github.com/users/iamdustan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iamdustan/babel-plugin-react-transform","description":"Babel plugin to instrument React components with custom transforms","fork":true,"url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform","forks_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/forks","keys_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/teams","hooks_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/hooks","issue_events_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/issues/events{/number}","events_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/events","assignees_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/assignees{/user}","branches_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/branches{/branch}","tags_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/tags","blobs_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/git/refs{/sha}","trees_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/statuses/{sha}","languages_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/languages","stargazers_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/stargazers","contributors_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/contributors","subscribers_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/subscribers","subscription_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/subscription","commits_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/commits{/sha}","git_commits_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/git/commits{/sha}","comments_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/comments{/number}","issue_comment_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/issues/comments{/number}","contents_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/contents/{+path}","compare_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/merges","archive_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/downloads","issues_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/issues{/number}","pulls_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/pulls{/number}","milestones_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/milestones{/number}","notifications_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/labels{/name}","releases_url":"https://api.github.com/repos/iamdustan/babel-plugin-react-transform/releases{/id}","created_at":"2015-10-06T14:36:35Z","updated_at":"2015-10-06T14:36:36Z","pushed_at":"2015-10-06T17:47:05Z","git_url":"git://github.com/iamdustan/babel-plugin-react-transform.git","ssh_url":"git@github.com:iamdustan/babel-plugin-react-transform.git","clone_url":"https://github.com/iamdustan/babel-plugin-react-transform.git","svn_url":"https://github.com/iamdustan/babel-plugin-react-transform","homepage":"","size":509,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gaearon:master","ref":"master","sha":"3a27b46436e95903e777299bfa34f5d4c93159f1","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},"repo":{"id":41516944,"name":"babel-plugin-react-transform","full_name":"gaearon/babel-plugin-react-transform","owner":{"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},"private":false,"html_url":"https://github.com/gaearon/babel-plugin-react-transform","description":"Babel plugin to instrument React components with custom transforms","fork":false,"url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform","forks_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/forks","keys_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/teams","hooks_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/hooks","issue_events_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/issues/events{/number}","events_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/events","assignees_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/assignees{/user}","branches_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/branches{/branch}","tags_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/tags","blobs_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/git/refs{/sha}","trees_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/statuses/{sha}","languages_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/languages","stargazers_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/stargazers","contributors_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/contributors","subscribers_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/subscribers","subscription_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/subscription","commits_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/commits{/sha}","git_commits_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/git/commits{/sha}","comments_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/comments{/number}","issue_comment_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/issues/comments{/number}","contents_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/contents/{+path}","compare_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/merges","archive_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/downloads","issues_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/issues{/number}","pulls_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/pulls{/number}","milestones_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/milestones{/number}","notifications_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/labels{/name}","releases_url":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/releases{/id}","created_at":"2015-08-27T23:50:00Z","updated_at":"2015-10-06T17:16:14Z","pushed_at":"2015-10-06T17:47:06Z","git_url":"git://github.com/gaearon/babel-plugin-react-transform.git","ssh_url":"git@github.com:gaearon/babel-plugin-react-transform.git","clone_url":"https://github.com/gaearon/babel-plugin-react-transform.git","svn_url":"https://github.com/gaearon/babel-plugin-react-transform","homepage":"","size":509,"stargazers_count":274,"watchers_count":274,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":9,"forks":15,"open_issues":9,"watchers":274,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/pulls/36"},"html":{"href":"https://github.com/gaearon/babel-plugin-react-transform/pull/36"},"issue":{"href":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/issues/36"},"comments":{"href":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/gaearon/babel-plugin-react-transform/statuses/eb8d1bf75f39c9113e289fe2fe7fcb8f9efdc7c6"}}}}