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.
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|