The Global API
1, React.createclass
Create a component class and make a definition. The component implements the render()
method that returns a child. The child may contain very deep sub-structures. The difference between a component and a standard prototype class is that you do not need to instantiate it with new. Components are a convenient package that can be created (via new) for you to create a background instance for you.
2, React.createelement
ReactElement createElement( string/ReactClass type, [object props], [children ...])
Creates and returns a new, specified type ReactElement
. The type parameter can be a string of HTML tag names (for example, "div", "span", and so on), or ReactClass
(by React.createClass
creation).
3, React.createfactory
Returns a function that generates reactelements of the specified type. For example React.createElement
, the type parameter can be a string of HTML tag names (for example, "div", "span", and so on), or aReactClass
4, React.render
Renders a reactelement to the DOM, placed container
under the specified DOM element, and returns a reference to the component.
If Reactelement has been rendered before container
, the function will update this reactelement, changing only the DOM nodes that need to be changed to show the latest React components.
If an optional callback function is provided, the function will be called after the component is rendered or updated
5, React.isvalidelement
6, React.proptypes
Wait a minute.
Component API
Reactjs Getting Started to combat (vi)----REACTJS Component API detailed