This commit is contained in:
Rico Sta. Cruz 2017-08-24 06:30:53 +08:00
parent d0142fb682
commit d95efb54c5
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
1 changed files with 10 additions and 5 deletions

View File

@ -167,14 +167,19 @@ DOM nodes
### References
```html
<input ref="myInput">
```jsx
class MyComponent extends React.Component {
render () {
return <div>
<input ref={el => this.input = el} />
</div>
}
}
```
```jsx
this.refs.myInput
ReactDOM.findDOMNode(this.refs.myInput).focus()
ReactDOM.findDOMNode(this.refs.myInput).value
this.input.focus()
this.input.value()
```
Allows access to DOM nodes. See [References](http://facebook.github.io/react/docs/more-about-refs.html).