Update React

This commit is contained in:
Rico Sta. Cruz 2015-02-26 15:14:22 +08:00
parent 0a673cdc87
commit ae6700abfd
1 changed files with 26 additions and 12 deletions

View File

@ -49,22 +49,36 @@ c.forceUpdate()
c.isMounted()
```
### [Methods](http://facebook.github.io/react/docs/component-specs.html)
```js
{
render: function()
getInitialState: function()
getDefaultProps: function()
mixins: []
propTypes: {} /* for validation */
statics: { .. } /* static methods */
displayName: '..' /* automatically filled in by jsx */
}
```
### [Lifecycle](http://facebook.github.io/react/docs/component-specs.html)
render: function()
getInitialState: function()
getDefaultProps: function()
propTypes: {}
mixins: []
statics: { .. } /* static methods */
displayName: '..'
```js
componentWillMount()
componentDidMount()
componentWillMount
componentWillUpdate
componentWillUnmount
// not on initial render
componentWillReceiveProps(props)
shouldComponentUpdate(props, state)
componentWillUpdate(props, state)
componentDidUpdate(prevProps, prevState)
componentDidMount
componentDidUpdate
componentWillUnmount()
// ...there is no DidUnmount or ReceiveState.
```
### Initial states