Update React
This commit is contained in:
parent
0a673cdc87
commit
ae6700abfd
38
react.md
38
react.md
|
@ -49,22 +49,36 @@ c.forceUpdate()
|
||||||
c.isMounted()
|
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)
|
### [Lifecycle](http://facebook.github.io/react/docs/component-specs.html)
|
||||||
|
|
||||||
render: function()
|
```js
|
||||||
getInitialState: function()
|
componentWillMount()
|
||||||
getDefaultProps: function()
|
componentDidMount()
|
||||||
propTypes: {}
|
|
||||||
mixins: []
|
|
||||||
statics: { .. } /* static methods */
|
|
||||||
displayName: '..'
|
|
||||||
|
|
||||||
componentWillMount
|
// not on initial render
|
||||||
componentWillUpdate
|
componentWillReceiveProps(props)
|
||||||
componentWillUnmount
|
shouldComponentUpdate(props, state)
|
||||||
|
componentWillUpdate(props, state)
|
||||||
|
componentDidUpdate(prevProps, prevState)
|
||||||
|
|
||||||
componentDidMount
|
componentWillUnmount()
|
||||||
componentDidUpdate
|
|
||||||
|
// ...there is no DidUnmount or ReceiveState.
|
||||||
|
```
|
||||||
|
|
||||||
### Initial states
|
### Initial states
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue