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