Alex Krolick 7 years ago
committed by GitHub
parent
commit
e5bf5945b3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      content/docs/refs-and-the-dom.md

6
content/docs/refs-and-the-dom.md

@ -276,15 +276,15 @@ class CustomTextInput extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.textInput = { current: null }; // initial placeholder for the ref this.textInput = null;
this.setTextInputRef = element => { this.setTextInputRef = element => {
this.textInput.current = element this.textInput = element
}; };
this.focusTextInput = () => { this.focusTextInput = () => {
// Focus the text input using the raw DOM API // Focus the text input using the raw DOM API
this.textInput.current.focus(); this.textInput.focus();
}; };
} }

Loading…
Cancel
Save