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.
14 lines
285 B
14 lines
285 B
class MyComponent extends React.Component {
|
|
// highlight-next-line
|
|
divRef = React.createRef();
|
|
|
|
render() {
|
|
// highlight-next-line
|
|
return <input type="text" ref={this.divRef} />;
|
|
}
|
|
|
|
componentDidMount() {
|
|
// highlight-next-line
|
|
this.divRef.value.focus();
|
|
}
|
|
}
|
|
|