()
| 2 | |
| 3 | /** Hook for programmaticall setting focus */ |
| 4 | export const useFocus = (): [React.RefObject<unknown>, () => void] => { |
| 5 | const htmlElRef = useRef(null); |
| 6 | const setFocus = () => { |
| 7 | htmlElRef.current && htmlElRef.current.focus(); |
| 8 | }; |
| 9 | |
| 10 | return [htmlElRef, setFocus]; |
| 11 | }; |