import { useRef } from "react";

function Test() {
    const newRef = useRef(null);
    function handleClick(){
        // focus 聚焦
        // blur 失焦
        console.log(newRef)
        newRef.current.focus()
    }
    return(
        <div>
            <h3>这是一个函数组件</h3>
            <input ref={newRef} type="text" />
            <button onClick={handleClick}>聚焦</button>
        </div>
    )
}
export default Test;