Skip to content

Top level api docs for createFactory #2675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 16, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions docs/docs/ref-01-top-level-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,39 @@ 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).


### 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
Expand Down