{"action":"opened","number":2685,"pull_request":{"url":"https://api.github.com/repos/facebookincubator/create-react-app/pulls/2685","id":128149243,"html_url":"https://github.com/facebookincubator/create-react-app/pull/2685","diff_url":"https://github.com/facebookincubator/create-react-app/pull/2685.diff","patch_url":"https://github.com/facebookincubator/create-react-app/pull/2685.patch","issue_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/2685","number":2685,"state":"open","locked":false,"title":"Add Generating new Component section to User Guide","user":{"login":"diegohaz","id":3068563,"avatar_url":"https://avatars0.githubusercontent.com/u/3068563?v=3","gravatar_id":"","url":"https://api.github.com/users/diegohaz","html_url":"https://github.com/diegohaz","followers_url":"https://api.github.com/users/diegohaz/followers","following_url":"https://api.github.com/users/diegohaz/following{/other_user}","gists_url":"https://api.github.com/users/diegohaz/gists{/gist_id}","starred_url":"https://api.github.com/users/diegohaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diegohaz/subscriptions","organizations_url":"https://api.github.com/users/diegohaz/orgs","repos_url":"https://api.github.com/users/diegohaz/repos","events_url":"https://api.github.com/users/diegohaz/events{/privacy}","received_events_url":"https://api.github.com/users/diegohaz/received_events","type":"User","site_admin":false},"body":"Related to #2482 \r\n\r\n## Generating new Component\r\n\r\nInstead of creating component files by hand, you can use [`generact`](https://github.com/diegohaz/generact) to generate new components based on existing ones.\r\n\r\n<p align=\"center\">\r\n  <img src=\"https://user-images.githubusercontent.com/3068563/27687316-bb5bd832-5cac-11e7-9761-c489e5a3a9f0.gif\" alt=\"Showing generact usage\" width=\"640\" />\r\n</p>\r\n\r\nOptionally, you can add it to `devDependencies` (`yarn add --dev generact`) and add an npm script to easily generate new components based on another specific one (e.g. `src/components/MySimpleBaseComponent/MySimpleBaseComponent.js`):\r\n\r\n```diff\r\n  \"scripts\": {\r\n    \"start\": \"react-scripts start\",\r\n    \"build\": \"react-scripts build\",\r\n    \"test\": \"react-scripts test --env=jsdom\",\r\n    \"eject\": \"react-scripts eject\",\r\n+   \"component\": \"generact src/components/MySimpleBaseComponent/MySimpleBaseComponent.js\"\r\n  }\r\n```\r\n\r\nThen, just run `yarn component`.","created_at":"2017-06-29T13:18:47Z","updated_at":"2017-06-29T13:18:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/facebookincubator/create-react-app/pulls/2685/commits","review_comments_url":"https://api.github.com/repos/facebookincubator/create-react-app/pulls/2685/comments","review_comment_url":"https://api.github.com/repos/facebookincubator/create-react-app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/2685/comments","statuses_url":"https://api.github.com/repos/facebookincubator/create-react-app/statuses/aba6294c8aec5fff2be39c70aa8987cd65d4c93d","head":{"label":"diegohaz:patch-1","ref":"patch-1","sha":"aba6294c8aec5fff2be39c70aa8987cd65d4c93d","user":{"login":"diegohaz","id":3068563,"avatar_url":"https://avatars0.githubusercontent.com/u/3068563?v=3","gravatar_id":"","url":"https://api.github.com/users/diegohaz","html_url":"https://github.com/diegohaz","followers_url":"https://api.github.com/users/diegohaz/followers","following_url":"https://api.github.com/users/diegohaz/following{/other_user}","gists_url":"https://api.github.com/users/diegohaz/gists{/gist_id}","starred_url":"https://api.github.com/users/diegohaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diegohaz/subscriptions","organizations_url":"https://api.github.com/users/diegohaz/orgs","repos_url":"https://api.github.com/users/diegohaz/repos","events_url":"https://api.github.com/users/diegohaz/events{/privacy}","received_events_url":"https://api.github.com/users/diegohaz/received_events","type":"User","site_admin":false},"repo":{"id":95776604,"name":"create-react-app","full_name":"diegohaz/create-react-app","owner":{"login":"diegohaz","id":3068563,"avatar_url":"https://avatars0.githubusercontent.com/u/3068563?v=3","gravatar_id":"","url":"https://api.github.com/users/diegohaz","html_url":"https://github.com/diegohaz","followers_url":"https://api.github.com/users/diegohaz/followers","following_url":"https://api.github.com/users/diegohaz/following{/other_user}","gists_url":"https://api.github.com/users/diegohaz/gists{/gist_id}","starred_url":"https://api.github.com/users/diegohaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diegohaz/subscriptions","organizations_url":"https://api.github.com/users/diegohaz/orgs","repos_url":"https://api.github.com/users/diegohaz/repos","events_url":"https://api.github.com/users/diegohaz/events{/privacy}","received_events_url":"https://api.github.com/users/diegohaz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/diegohaz/create-react-app","description":"Create React apps with no build configuration.","fork":true,"url":"https://api.github.com/repos/diegohaz/create-react-app","forks_url":"https://api.github.com/repos/diegohaz/create-react-app/forks","keys_url":"https://api.github.com/repos/diegohaz/create-react-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diegohaz/create-react-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diegohaz/create-react-app/teams","hooks_url":"https://api.github.com/repos/diegohaz/create-react-app/hooks","issue_events_url":"https://api.github.com/repos/diegohaz/create-react-app/issues/events{/number}","events_url":"https://api.github.com/repos/diegohaz/create-react-app/events","assignees_url":"https://api.github.com/repos/diegohaz/create-react-app/assignees{/user}","branches_url":"https://api.github.com/repos/diegohaz/create-react-app/branches{/branch}","tags_url":"https://api.github.com/repos/diegohaz/create-react-app/tags","blobs_url":"https://api.github.com/repos/diegohaz/create-react-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diegohaz/create-react-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diegohaz/create-react-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/diegohaz/create-react-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diegohaz/create-react-app/statuses/{sha}","languages_url":"https://api.github.com/repos/diegohaz/create-react-app/languages","stargazers_url":"https://api.github.com/repos/diegohaz/create-react-app/stargazers","contributors_url":"https://api.github.com/repos/diegohaz/create-react-app/contributors","subscribers_url":"https://api.github.com/repos/diegohaz/create-react-app/subscribers","subscription_url":"https://api.github.com/repos/diegohaz/create-react-app/subscription","commits_url":"https://api.github.com/repos/diegohaz/create-react-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/diegohaz/create-react-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/diegohaz/create-react-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/diegohaz/create-react-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/diegohaz/create-react-app/contents/{+path}","compare_url":"https://api.github.com/repos/diegohaz/create-react-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diegohaz/create-react-app/merges","archive_url":"https://api.github.com/repos/diegohaz/create-react-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diegohaz/create-react-app/downloads","issues_url":"https://api.github.com/repos/diegohaz/create-react-app/issues{/number}","pulls_url":"https://api.github.com/repos/diegohaz/create-react-app/pulls{/number}","milestones_url":"https://api.github.com/repos/diegohaz/create-react-app/milestones{/number}","notifications_url":"https://api.github.com/repos/diegohaz/create-react-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diegohaz/create-react-app/labels{/name}","releases_url":"https://api.github.com/repos/diegohaz/create-react-app/releases{/id}","deployments_url":"https://api.github.com/repos/diegohaz/create-react-app/deployments","created_at":"2017-06-29T12:45:05Z","updated_at":"2017-06-29T12:45:09Z","pushed_at":"2017-06-29T13:15:33Z","git_url":"git://github.com/diegohaz/create-react-app.git","ssh_url":"git@github.com:diegohaz/create-react-app.git","clone_url":"https://github.com/diegohaz/create-react-app.git","svn_url":"https://github.com/diegohaz/create-react-app","homepage":null,"size":3836,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"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":"facebookincubator:master","ref":"master","sha":"29888fcc7a5a6d658f41dc58fb2a7fa617b719e0","user":{"login":"facebookincubator","id":19538647,"avatar_url":"https://avatars1.githubusercontent.com/u/19538647?v=3","gravatar_id":"","url":"https://api.github.com/users/facebookincubator","html_url":"https://github.com/facebookincubator","followers_url":"https://api.github.com/users/facebookincubator/followers","following_url":"https://api.github.com/users/facebookincubator/following{/other_user}","gists_url":"https://api.github.com/users/facebookincubator/gists{/gist_id}","starred_url":"https://api.github.com/users/facebookincubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebookincubator/subscriptions","organizations_url":"https://api.github.com/users/facebookincubator/orgs","repos_url":"https://api.github.com/users/facebookincubator/repos","events_url":"https://api.github.com/users/facebookincubator/events{/privacy}","received_events_url":"https://api.github.com/users/facebookincubator/received_events","type":"Organization","site_admin":false},"repo":{"id":63537249,"name":"create-react-app","full_name":"facebookincubator/create-react-app","owner":{"login":"facebookincubator","id":19538647,"avatar_url":"https://avatars1.githubusercontent.com/u/19538647?v=3","gravatar_id":"","url":"https://api.github.com/users/facebookincubator","html_url":"https://github.com/facebookincubator","followers_url":"https://api.github.com/users/facebookincubator/followers","following_url":"https://api.github.com/users/facebookincubator/following{/other_user}","gists_url":"https://api.github.com/users/facebookincubator/gists{/gist_id}","starred_url":"https://api.github.com/users/facebookincubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebookincubator/subscriptions","organizations_url":"https://api.github.com/users/facebookincubator/orgs","repos_url":"https://api.github.com/users/facebookincubator/repos","events_url":"https://api.github.com/users/facebookincubator/events{/privacy}","received_events_url":"https://api.github.com/users/facebookincubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebookincubator/create-react-app","description":"Create React apps with no build configuration.","fork":false,"url":"https://api.github.com/repos/facebookincubator/create-react-app","forks_url":"https://api.github.com/repos/facebookincubator/create-react-app/forks","keys_url":"https://api.github.com/repos/facebookincubator/create-react-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebookincubator/create-react-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebookincubator/create-react-app/teams","hooks_url":"https://api.github.com/repos/facebookincubator/create-react-app/hooks","issue_events_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/events{/number}","events_url":"https://api.github.com/repos/facebookincubator/create-react-app/events","assignees_url":"https://api.github.com/repos/facebookincubator/create-react-app/assignees{/user}","branches_url":"https://api.github.com/repos/facebookincubator/create-react-app/branches{/branch}","tags_url":"https://api.github.com/repos/facebookincubator/create-react-app/tags","blobs_url":"https://api.github.com/repos/facebookincubator/create-react-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebookincubator/create-react-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebookincubator/create-react-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebookincubator/create-react-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebookincubator/create-react-app/statuses/{sha}","languages_url":"https://api.github.com/repos/facebookincubator/create-react-app/languages","stargazers_url":"https://api.github.com/repos/facebookincubator/create-react-app/stargazers","contributors_url":"https://api.github.com/repos/facebookincubator/create-react-app/contributors","subscribers_url":"https://api.github.com/repos/facebookincubator/create-react-app/subscribers","subscription_url":"https://api.github.com/repos/facebookincubator/create-react-app/subscription","commits_url":"https://api.github.com/repos/facebookincubator/create-react-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebookincubator/create-react-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebookincubator/create-react-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebookincubator/create-react-app/contents/{+path}","compare_url":"https://api.github.com/repos/facebookincubator/create-react-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebookincubator/create-react-app/merges","archive_url":"https://api.github.com/repos/facebookincubator/create-react-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebookincubator/create-react-app/downloads","issues_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues{/number}","pulls_url":"https://api.github.com/repos/facebookincubator/create-react-app/pulls{/number}","milestones_url":"https://api.github.com/repos/facebookincubator/create-react-app/milestones{/number}","notifications_url":"https://api.github.com/repos/facebookincubator/create-react-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebookincubator/create-react-app/labels{/name}","releases_url":"https://api.github.com/repos/facebookincubator/create-react-app/releases{/id}","deployments_url":"https://api.github.com/repos/facebookincubator/create-react-app/deployments","created_at":"2016-07-17T14:55:11Z","updated_at":"2017-06-29T13:15:32Z","pushed_at":"2017-06-29T13:09:21Z","git_url":"git://github.com/facebookincubator/create-react-app.git","ssh_url":"git@github.com:facebookincubator/create-react-app.git","clone_url":"https://github.com/facebookincubator/create-react-app.git","svn_url":"https://github.com/facebookincubator/create-react-app","homepage":null,"size":3892,"stargazers_count":29437,"watchers_count":29437,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4370,"mirror_url":null,"open_issues_count":273,"forks":4370,"open_issues":273,"watchers":29437,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebookincubator/create-react-app/pulls/2685"},"html":{"href":"https://github.com/facebookincubator/create-react-app/pull/2685"},"issue":{"href":"https://api.github.com/repos/facebookincubator/create-react-app/issues/2685"},"comments":{"href":"https://api.github.com/repos/facebookincubator/create-react-app/issues/2685/comments"},"review_comments":{"href":"https://api.github.com/repos/facebookincubator/create-react-app/pulls/2685/comments"},"review_comment":{"href":"https://api.github.com/repos/facebookincubator/create-react-app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebookincubator/create-react-app/pulls/2685/commits"},"statuses":{"href":"https://api.github.com/repos/facebookincubator/create-react-app/statuses/aba6294c8aec5fff2be39c70aa8987cd65d4c93d"}},"merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":2,"additions":24,"deletions":0,"changed_files":2}}
{"actor":{"display_login":"diegohaz"}}