Deprecation notes for setProps et al
This commit is contained in:
parent
5e91475913
commit
a1dbf7063d
26
react.md
26
react.md
|
@ -45,15 +45,19 @@ Use [props](https://facebook.github.io/react/docs/tutorial.html#using-props) (`t
|
|||
Use [states](https://facebook.github.io/react/docs/tutorial.html#reactive-state) (`this.state`) to manage dynamic data.
|
||||
{:.center}
|
||||
|
||||
```html
|
||||
<MyComponent fullscreen={true} />
|
||||
```
|
||||
{:.light}
|
||||
|
||||
```js
|
||||
this.setProps({ fullscreen: true });
|
||||
this.setState({ username: 'rstacruz' });
|
||||
// props
|
||||
this.props.fullscreen //=> true
|
||||
|
||||
this.props.fullscreen === true
|
||||
this.state.username === 'rstacruz'
|
||||
|
||||
this.replaceProps({ ... });
|
||||
this.replaceState({ ... });
|
||||
// state
|
||||
this.setState({ username: 'rstacruz' });
|
||||
this.replaceState({ ... });
|
||||
this.state.username //=> 'rstacruz'
|
||||
```
|
||||
|
||||
```js
|
||||
|
@ -86,6 +90,7 @@ These are methods available for `Component` instances. See [Component API](http:
|
|||
|
||||
```js
|
||||
React.findDOMNode(c) // 0.13+
|
||||
c.getDOMNode() // 0.12 below
|
||||
```
|
||||
{:.light}
|
||||
|
||||
|
@ -97,9 +102,10 @@ c.state
|
|||
c.props
|
||||
|
||||
c.setState({ ... })
|
||||
c.setProps({ ... })
|
||||
c.replaceState({ ... })
|
||||
c.replaceProps({ ... })
|
||||
|
||||
c.setProps({ ... }) // for deprecation
|
||||
c.replaceProps({ ... }) // for deprecation
|
||||
|
||||
c.refs
|
||||
```
|
||||
|
@ -355,7 +361,7 @@ var TickTock = React.createClass({
|
|||
## [Top level API](https://facebook.github.io/react/docs/top-level-api.html)
|
||||
|
||||
```js
|
||||
React.findDOMNode(c)
|
||||
React.findDOMNode(c) // 0.13+
|
||||
React.createClass({ ... })
|
||||
|
||||
React.render(<Component />, domnode, [callback])
|
||||
|
|
Loading…
Reference in New Issue