Update
This commit is contained in:
parent
d0142fb682
commit
d95efb54c5
15
react.md
15
react.md
|
|
@ -167,14 +167,19 @@ DOM nodes
|
||||||
|
|
||||||
### References
|
### References
|
||||||
|
|
||||||
```html
|
```jsx
|
||||||
<input ref="myInput">
|
class MyComponent extends React.Component {
|
||||||
|
render () {
|
||||||
|
return <div>
|
||||||
|
<input ref={el => this.input = el} />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
this.refs.myInput
|
this.input.focus()
|
||||||
ReactDOM.findDOMNode(this.refs.myInput).focus()
|
this.input.value()
|
||||||
ReactDOM.findDOMNode(this.refs.myInput).value
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Allows access to DOM nodes. See [References](http://facebook.github.io/react/docs/more-about-refs.html).
|
Allows access to DOM nodes. See [References](http://facebook.github.io/react/docs/more-about-refs.html).
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue