Renamed ref in example

This commit is contained in:
Brian Vaughn
2018-03-18 08:03:28 -07:00
parent fe033f675d
commit f14f1477d5

View File

@@ -1,14 +1,14 @@
class MyComponent extends React.Component {
// highlight-next-line
divRef = React.createRef();
inputRef = React.createRef();
render() {
// highlight-next-line
return <input type="text" ref={this.divRef} />;
return <input type="text" ref={this.inputRef} />;
}
componentDidMount() {
// highlight-next-line
this.divRef.current.focus();
this.inputRef.current.focus();
}
}