mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
Renamed ref in example
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user