Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/docs/refs-and-the-dom.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ When the `ref` attribute is used on an HTML element, the `ref` callback receives
class CustomTextInput extends React.Component {
constructor(props) {
super(props);
this.focus = this.focus.bind(this);
this.focusTextInput = this.focusTextInput.bind(this);
}

focus() {
focusTextInput() {
// Explicitly focus the text input using the raw DOM API
this.textInput.focus();
}
Expand Down Expand Up @@ -77,7 +77,7 @@ When the `ref` attribute is used on a custom component declared as a class, the
```javascript{3,9}
class AutoFocusTextInput extends React.Component {
componentDidMount() {
this.textInput.focus();
this.textInput.focusTextInput();
}

render() {
Expand Down