Browse Source

Fixed docs

main
Brian Vaughn 7 years ago
parent
commit
2f97f485ce
  1. 6
      content/docs/refs-and-the-dom.md

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

@ -279,18 +279,18 @@ class CustomTextInput extends React.Component {
this.textInput = null;
this.setTextInputRef = element => {
this.textInput = element
this.textInput = element;
};
this.focusTextInput = () => {
// Focus the text input using the raw DOM API
this.textInput.focus();
if (this.textInput) this.textInput.focus();
};
}
componentDidMount() {
// autofocus the input on mount
if (this.textInput.current) this.focusTextInput()
this.focusTextInput();
}
render() {

Loading…
Cancel
Save