Learning documents (by Priority)
Http://reactjs.cn/react/docs/tutorial-zh-CN.html
http://www.cnblogs.com/Mrs-cc/p/4969755.html (compatibility of ES5 with ES6)
React.createclass ()
We pass some methods in a JavaScript object to React.createclass () to create a new React component. The most important of these methods is render, which returns a React component tree, not the actual HTML, which will eventually be rendered as HTML.
Reactdom.render ()
Reactdom.render () Instantiates the root component, launches the framework, injects markup into the original DOM element, and provides as a second argument.
The Reactdom module exposes DOM-related methods, while React retains the core tools (such as React Native) that are shared by React on different platforms.
This.props
In JSX, you can place a text or React component in a tree by placing the JavaScript expression in curly braces (as a property or a child node). We use the This.props keys to access the named properties passed to the component to This.props.children access to any nested elements.
Props are immutable: they are transmitted from the parent and are "owned" by the parent.
This.props.data.map ()
var names = [‘Alice‘, ‘Emily‘, ‘Kate‘];names.map(function (name) { return <div>Hello, {name}!</div>})
This.state
In order to achieve interaction, we introduced a mutable state to the component. State is reserved only for interactivity, that is, data that changes over time. This.state is a component-private and can be changed by calling This.setstate (). The component re-renders itself whenever the state is updated.
Getinitialstate ()
Getinitialstate () executes only once in the life cycle and sets the initial state of the component.
//es5getInitialState: function(){ return {liked: false};}
//es6constructor(props){ super(props); this.state = {liked: false};}
This.setstate ()
Sets the value of the state within the component. The key to dynamic update is the call to This.setstate ().
Componentdidmount ()
Componentdidmount () is a method that is automatically called by react when a component is rendered.
React basic knowledge