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.

20 lines
323 B

class MyComponent extends React.Component {
// highlight-next-line
_divRef = React.createRef();
render() {
// highlight-range{4}
return (
<input
type="text"
ref={this._divRef}
/>
);
}
componentDidMount() {
// highlight-next-line
this._divRef.value.focus();
}
}