You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
285 B
15 lines
285 B
7 years ago
|
class MyComponent extends React.Component {
|
||
|
// highlight-next-line
|
||
7 years ago
|
divRef = React.createRef();
|
||
7 years ago
|
|
||
|
render() {
|
||
7 years ago
|
// highlight-next-line
|
||
|
return <input type="text" ref={this.divRef} />;
|
||
7 years ago
|
}
|
||
|
|
||
|
componentDidMount() {
|
||
|
// highlight-next-line
|
||
7 years ago
|
this.divRef.value.focus();
|
||
7 years ago
|
}
|
||
|
}
|