From 132a022936223e8beb2aece9324d712d33435012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Fri, 16 Jan 2015 13:18:28 -0800 Subject: [PATCH] Merge pull request #2675 from af/topLevelAPIDocs Top level api docs for createFactory --- docs/docs/ref-01-top-level-api.md | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/docs/docs/ref-01-top-level-api.md b/docs/docs/ref-01-top-level-api.md index 39bc37b169..7beb8b152b 100644 --- a/docs/docs/ref-01-top-level-api.md +++ b/docs/docs/ref-01-top-level-api.md @@ -14,10 +14,10 @@ redirect_from: "/docs/reference.html" ### React.createClass ```javascript -function createClass(object specification) +ReactClass createClass(object specification) ``` -Create a component given a specification. A component implements a `render` method which returns **one single** child. That child may have an arbitrarily deep child structure. One thing that makes components different than standard prototypal classes is that you don't need to call new on them. They are convenience wrappers that construct backing instances (via new) for you. +Create a component class, given a specification. A component implements a `render` method which returns **one single** child. That child may have an arbitrarily deep child structure. One thing that makes components different than standard prototypal classes is that you don't need to call new on them. They are convenience wrappers that construct backing instances (via new) for you. For more information about the specification object, see [Component Specs and Lifecycle](/react/docs/component-specs.html). @@ -25,16 +25,28 @@ For more information about the specification object, see [Component Specs and Li ### React.createElement ```javascript -function createElement( - string/ReactComponent type, +ReactElement createElement( + string/ReactClass type, [object props], [children ...] ) ``` -Create and return a new ReactElement of the given type. The type argument can be either an -html tag name string (eg. 'div', 'span', etc), or a `ReactComponent` class that was created -with `React.createClass`. +Create and return a new `ReactElement` of the given type. The type argument can be either an +html tag name string (eg. 'div', 'span', etc), or a `ReactClass` (created via `React.createClass`). + + +### React.createFactory + +```javascript +factoryFunction createFactory( + string/ReactClass type +) +``` + +Return a function that produces ReactElements of a given type. Like `React.createElement`, +the type argument can be either an html tag name string (eg. 'div', 'span', etc), or a +`ReactClass`. ### React.render