UNPKG

@nikitababko/react-custom-hooks

Version:
11 lines (8 loc) 210 B
import { useRef } from 'react'; export default () => { const htmlElRef = useRef(null); const setFocus = () => { htmlElRef.current && htmlElRef.current.focus(); }; return [htmlElRef, setFocus]; };