{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/react/pulls/comments/82704003","pull_request_review_id":3591831,"id":82704003,"diff_hunk":"@@ -0,0 +1,149 @@\n+---\n+id: reference-react\n+title: React Top-Level API\n+permalink: docs/reference-react.html\n+next: reference-react-dom.html\n+redirect_from: \"/docs/reference.html\"\n+---\n+\n+`React` is the entry point to the React library. If you're using one of the prebuilt packages it's available as a global; if you're using CommonJS modules you can `require()` it.\n+\n+## Reference\n+\n+ - [`React.Component`](#react.component)\n+ - [`createClass()`](#createclass)\n+ - [`createElement()`](#createlement)\n+ - [`cloneElement()`](#cloneelement)\n+ - [`createFactory()`](#createfactory)\n+ - [`isValidElement()`](#isvalidelement)\n+ - [`PropTypes`](#proptypes)\n+ - [`Children`](#children)\n+\n+### `React.Component`\n+\n+```javascript\n+class Greeting extends React.Component {\n+  render() {\n+    return <h1>Hello, {this.props.name}</h1>;\n+  }\n+}\n+```\n+\n+`React.Component` is the base class for React components when they are defined using ES6 classes. See the [React.Component API Reference](/react/docs/reference-react-component.html) for a list of methods are provided by the base `React.Component` class.\n+\n+### `createClass()`\n+\n+```javascript\n+React.createClass(specification)\n+```\n+\n+If you don't use ES6 yet, you may use the `React.createClass` helper instead to create a component class. See [Using React without ES6](/react/docs/react-without-es6.html) for more information.\n+\n+### `createElement()`\n+\n+```javascript\n+React.createElement(\n+  type,\n+  [props],\n+  [children ...]\n+)\n+```\n+\n+Create and return a new React element of the given type. The type argument can be either an\n+html tag name string (eg. 'div', 'span', etc), or a React class (created via `React.createClass`).\n+\n+Code written with JSX will be converted to use `React.createElement`. You will not typically call `React.createElement` directly if you are using JSX.\n+\n+Convenience wrappers around `React.createElement` for DOM components are provided by `React.DOM`. For example, `React.DOM.a(...)` is a convenience wrapper for `React.createElement('a', ...)`.\n+\n+See [React Without JSX](/react/docs/react-without-jsx.html) to learn more.\n+\n+### `cloneElement()`\n+\n+```\n+React.cloneElement(\n+  element,\n+  [props],\n+  [children ...]\n+)\n+```\n+\n+Clone and return a new React element using `element` as the starting point. The resulting element will have the original element's props with the new props merged in shallowly. New children will replace existing children. `key` and `ref` from the original element will be preserved.\n+\n+`React.cloneElement` is almost equivalent to:\n+\n+```js\n+<element.type {...element.props} {...props}>{children}</element.type>\n+```\n+\n+However, it also preserves `ref`s. This means that if you get a child with a `ref` on it, you won't accidentally steal it from your ancestor. You will get the same `ref` attached to your new element.\n+\n+This API was introduced as a replacement of the deprecated `React.addons.cloneWithProps`.\n+\n+### `createFactory()`\n+\n+```javascript\n+React.createFactory(type)\n+```\n+\n+Return a function that produces React elements of a given type. Like [`React.createElement`](#createElement), the type argument can be either an html tag name string (eg. 'div', 'span', etc), or a `ReactClass`.\n+","path":"docs/docs/reference-react.md","position":90,"original_position":90,"commit_id":"fdb126d89398b4ca0d6d3a4bd3c43798a0a688e4","original_commit_id":"fdb126d89398b4ca0d6d3a4bd3c43798a0a688e4","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},"body":"Again, I think we should stop using `ReactClass`. This notation is misleading (e.g. \"ReactClass\" here could also be a function). Let's just consistently say \"React component defined as a class or a function\". ","created_at":"2016-10-10T23:54:32Z","updated_at":"2016-10-10T23:54:32Z","html_url":"https://github.com/facebook/react/pull/7931#discussion_r82704003","pull_request_url":"https://api.github.com/repos/facebook/react/pulls/7931","_links":{"self":{"href":"https://api.github.com/repos/facebook/react/pulls/comments/82704003"},"html":{"href":"https://github.com/facebook/react/pull/7931#discussion_r82704003"},"pull_request":{"href":"https://api.github.com/repos/facebook/react/pulls/7931"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/react/pulls/7931","id":88742077,"html_url":"https://github.com/facebook/react/pull/7931","diff_url":"https://github.com/facebook/react/pull/7931.diff","patch_url":"https://github.com/facebook/react/pull/7931.patch","issue_url":"https://api.github.com/repos/facebook/react/issues/7931","number":7931,"state":"open","locked":false,"title":"[Website] [API Reference] React, ReactDOM, ReactDOMServer Reference Guides","user":{"login":"hramos","id":165856,"avatar_url":"https://avatars.githubusercontent.com/u/165856?v=3","gravatar_id":"","url":"https://api.github.com/users/hramos","html_url":"https://github.com/hramos","followers_url":"https://api.github.com/users/hramos/followers","following_url":"https://api.github.com/users/hramos/following{/other_user}","gists_url":"https://api.github.com/users/hramos/gists{/gist_id}","starred_url":"https://api.github.com/users/hramos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hramos/subscriptions","organizations_url":"https://api.github.com/users/hramos/orgs","repos_url":"https://api.github.com/users/hramos/repos","events_url":"https://api.github.com/users/hramos/events{/privacy}","received_events_url":"https://api.github.com/users/hramos/received_events","type":"User","site_admin":false},"body":"Based on the [Top-Level API Reference](https://facebook.github.io/react/docs/top-level-api.html).\r\n\r\nThis is now split into three reference docs:\r\n\r\n- React\r\n- ReactDOM\r\n- ReactDOMServer\r\n\r\nThe last two used to be bundled together with the React top-level API reference, and I think the intro paragraphs for these two new documents can be expanded. Looking for feedback on what information is missing from these guides and what is no longer relevant (e.g. React.DOM is less prominent in the new reference, as is React.createElement).\r\n\r\n## React\r\n\r\n![screencapture-localhost-4000-react-docs-reference-react-html-1476138699370](https://cloud.githubusercontent.com/assets/165856/19253259/b6bbfd24-8efe-11e6-9b28-b404f5b42e7e.png)\r\n\r\n## ReactDOM\r\n\r\n![screencapture-localhost-4000-react-docs-reference-react-dom-html-1476138707064](https://cloud.githubusercontent.com/assets/165856/19253262/bcd9970c-8efe-11e6-93da-c43353e53e0b.png)\r\n\r\n## ReactDOMServer\r\n\r\n![screencapture-localhost-4000-react-docs-reference-react-dom-server-html-1476138714162](https://cloud.githubusercontent.com/assets/165856/19253267/c3083e76-8efe-11e6-91fb-889462e727cb.png)\r\n\r\n\r\n","created_at":"2016-10-10T22:31:20Z","updated_at":"2016-10-10T23:55:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c223b885c7ec7ef814864cf7790a503dd6bd59f0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/facebook/react/pulls/7931/commits","review_comments_url":"https://api.github.com/repos/facebook/react/pulls/7931/comments","review_comment_url":"https://api.github.com/repos/facebook/react/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/react/issues/7931/comments","statuses_url":"https://api.github.com/repos/facebook/react/statuses/fdb126d89398b4ca0d6d3a4bd3c43798a0a688e4","head":{"label":"hramos:reference","ref":"reference","sha":"fdb126d89398b4ca0d6d3a4bd3c43798a0a688e4","user":{"login":"hramos","id":165856,"avatar_url":"https://avatars.githubusercontent.com/u/165856?v=3","gravatar_id":"","url":"https://api.github.com/users/hramos","html_url":"https://github.com/hramos","followers_url":"https://api.github.com/users/hramos/followers","following_url":"https://api.github.com/users/hramos/following{/other_user}","gists_url":"https://api.github.com/users/hramos/gists{/gist_id}","starred_url":"https://api.github.com/users/hramos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hramos/subscriptions","organizations_url":"https://api.github.com/users/hramos/orgs","repos_url":"https://api.github.com/users/hramos/repos","events_url":"https://api.github.com/users/hramos/events{/privacy}","received_events_url":"https://api.github.com/users/hramos/received_events","type":"User","site_admin":false},"repo":{"id":70006618,"name":"react","full_name":"hramos/react","owner":{"login":"hramos","id":165856,"avatar_url":"https://avatars.githubusercontent.com/u/165856?v=3","gravatar_id":"","url":"https://api.github.com/users/hramos","html_url":"https://github.com/hramos","followers_url":"https://api.github.com/users/hramos/followers","following_url":"https://api.github.com/users/hramos/following{/other_user}","gists_url":"https://api.github.com/users/hramos/gists{/gist_id}","starred_url":"https://api.github.com/users/hramos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hramos/subscriptions","organizations_url":"https://api.github.com/users/hramos/orgs","repos_url":"https://api.github.com/users/hramos/repos","events_url":"https://api.github.com/users/hramos/events{/privacy}","received_events_url":"https://api.github.com/users/hramos/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hramos/react","description":"A declarative, efficient, and flexible JavaScript library for building user interfaces.","fork":true,"url":"https://api.github.com/repos/hramos/react","forks_url":"https://api.github.com/repos/hramos/react/forks","keys_url":"https://api.github.com/repos/hramos/react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hramos/react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hramos/react/teams","hooks_url":"https://api.github.com/repos/hramos/react/hooks","issue_events_url":"https://api.github.com/repos/hramos/react/issues/events{/number}","events_url":"https://api.github.com/repos/hramos/react/events","assignees_url":"https://api.github.com/repos/hramos/react/assignees{/user}","branches_url":"https://api.github.com/repos/hramos/react/branches{/branch}","tags_url":"https://api.github.com/repos/hramos/react/tags","blobs_url":"https://api.github.com/repos/hramos/react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hramos/react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hramos/react/git/refs{/sha}","trees_url":"https://api.github.com/repos/hramos/react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hramos/react/statuses/{sha}","languages_url":"https://api.github.com/repos/hramos/react/languages","stargazers_url":"https://api.github.com/repos/hramos/react/stargazers","contributors_url":"https://api.github.com/repos/hramos/react/contributors","subscribers_url":"https://api.github.com/repos/hramos/react/subscribers","subscription_url":"https://api.github.com/repos/hramos/react/subscription","commits_url":"https://api.github.com/repos/hramos/react/commits{/sha}","git_commits_url":"https://api.github.com/repos/hramos/react/git/commits{/sha}","comments_url":"https://api.github.com/repos/hramos/react/comments{/number}","issue_comment_url":"https://api.github.com/repos/hramos/react/issues/comments{/number}","contents_url":"https://api.github.com/repos/hramos/react/contents/{+path}","compare_url":"https://api.github.com/repos/hramos/react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hramos/react/merges","archive_url":"https://api.github.com/repos/hramos/react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hramos/react/downloads","issues_url":"https://api.github.com/repos/hramos/react/issues{/number}","pulls_url":"https://api.github.com/repos/hramos/react/pulls{/number}","milestones_url":"https://api.github.com/repos/hramos/react/milestones{/number}","notifications_url":"https://api.github.com/repos/hramos/react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hramos/react/labels{/name}","releases_url":"https://api.github.com/repos/hramos/react/releases{/id}","deployments_url":"https://api.github.com/repos/hramos/react/deployments","created_at":"2016-10-04T21:10:18Z","updated_at":"2016-10-04T21:10:23Z","pushed_at":"2016-10-10T22:27:36Z","git_url":"git://github.com/hramos/react.git","ssh_url":"git@github.com:hramos/react.git","clone_url":"https://github.com/hramos/react.git","svn_url":"https://github.com/hramos/react","homepage":"https://facebook.github.io/react/","size":103149,"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":"facebook:new-docs","ref":"new-docs","sha":"7314beb1180427e970338ebcbb19279008a7b647","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":10270250,"name":"react","full_name":"facebook/react","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/react","description":"A declarative, efficient, and flexible JavaScript library for building user interfaces.","fork":false,"url":"https://api.github.com/repos/facebook/react","forks_url":"https://api.github.com/repos/facebook/react/forks","keys_url":"https://api.github.com/repos/facebook/react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/react/teams","hooks_url":"https://api.github.com/repos/facebook/react/hooks","issue_events_url":"https://api.github.com/repos/facebook/react/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/react/events","assignees_url":"https://api.github.com/repos/facebook/react/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/react/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/react/tags","blobs_url":"https://api.github.com/repos/facebook/react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/react/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/react/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/react/languages","stargazers_url":"https://api.github.com/repos/facebook/react/stargazers","contributors_url":"https://api.github.com/repos/facebook/react/contributors","subscribers_url":"https://api.github.com/repos/facebook/react/subscribers","subscription_url":"https://api.github.com/repos/facebook/react/subscription","commits_url":"https://api.github.com/repos/facebook/react/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/react/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/react/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/react/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/react/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/react/merges","archive_url":"https://api.github.com/repos/facebook/react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/react/downloads","issues_url":"https://api.github.com/repos/facebook/react/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/react/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/react/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/react/labels{/name}","releases_url":"https://api.github.com/repos/facebook/react/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/react/deployments","created_at":"2013-05-24T16:15:54Z","updated_at":"2016-10-10T23:26:19Z","pushed_at":"2016-10-10T23:46:38Z","git_url":"git://github.com/facebook/react.git","ssh_url":"git@github.com:facebook/react.git","clone_url":"https://github.com/facebook/react.git","svn_url":"https://github.com/facebook/react","homepage":"https://facebook.github.io/react/","size":139462,"stargazers_count":51376,"watchers_count":51376,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":8974,"mirror_url":null,"open_issues_count":709,"forks":8974,"open_issues":709,"watchers":51376,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/react/pulls/7931"},"html":{"href":"https://github.com/facebook/react/pull/7931"},"issue":{"href":"https://api.github.com/repos/facebook/react/issues/7931"},"comments":{"href":"https://api.github.com/repos/facebook/react/issues/7931/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/react/pulls/7931/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/react/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/react/pulls/7931/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/react/statuses/fdb126d89398b4ca0d6d3a4bd3c43798a0a688e4"}}}}
{"actor":{"display_login":"gaearon"}}