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
320 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();
}
7 years ago
}