1function CustomTextInput(props) {
2 // textInput must be declared here so the ref can refer to it
3 const textInput = useRef(null);
4
5 function handleClick() {
6 textInput.current.focus();
7 }
8
9 return (
10 <div>
11 <input
12 type="text"
13 ref={textInput} />
14 </div>
15 );
16}