From d95efb54c54f2e718f5f8ca4bbd31943dcf4e4c3 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Thu, 24 Aug 2017 06:30:53 +0800 Subject: [PATCH] Update --- react.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/react.md b/react.md index 540f8cbef..463f1b8c1 100644 --- a/react.md +++ b/react.md @@ -167,14 +167,19 @@ DOM nodes ### References -```html - +```jsx +class MyComponent extends React.Component { + render () { + return
+ this.input = el} /> +
+ } +} ``` ```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).