Facebook Open source JavaScript library: React

Source: Internet
Author: User
Tags xml attribute

react is Facebook's open source JavaScript library, which uses declarative paradigms to pass declarative code to minimize interaction with the DOM.

React is Facebook's open source JavaScript library for building the UI. You can pass multiple types of parameters in react, such as declaring code, to help you render the UI, to be static HTML DOM elements, to pass dynamic variables, and even to interact with application components. (Text from JS developer Weibo)

Characteristics:

    • Declarative design: React using declarative paradigms, you can easily describe your application
    • Efficient: Reeact minimizes interaction with the DOM by simulating the performance of the DOM.
    • Flexible: React can work well with libraries or frameworks you know.

Example

A simple component

The following code will render "Hello John" in the page container:

[XML]View Plaincopy
    1. /**  @jsx  react.dom */  
    2. var  hellomessage = react.createclass ({    
    3.  render: function ()  {      
    4.  return <div>{' Hello   '  + this.props.name}</div>;    
    5. &NBSP;}});   
    6. react.rendercomponent (<hellomessage  name= "John"  />, mountnode );   
This example uses an XML-like JSX to build the component, implements a render () method, and returns the corresponding result based on the input data. The input data is passed as an XML attribute to the component, and the render () method accesses the input data through This.props.

For more examples and tutorials, you can visit our official website tutorial: http://facebook.github.io/react/docs/tutorial.html

Official homepage: http://facebook.github.io/react/index.html

: http://facebook.github.io/react/downloads.html

GitHub Address: Https://github.com/facebook/react

Facebook Open source JavaScript library: React

Related Article

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.