Reactjs Introduction to Combat (vi)----REACTJS Component API

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.