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
- /** @jsx react.dom */
- var hellomessage = react.createclass ({
- render: function () {
- return <div>{' Hello ' + this.props.name}</div>;
- &NBSP;}});
- 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