Created
February 13, 2019 05:48
-
-
Save jrwebdev/0b7ba1f0bd0da2dcdecdd1112c0f2787 to your computer and use it in GitHub Desktop.
Revisions
-
jrwebdev created this gist
Feb 13, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ import MyInput, { MyInputHandles } from './MyInput'; const Autofocus = () => { const myInputRef = useRef<MyInputHandles>(null); useEffect(() => { if (myInputRef.current) { myInputRef.current.focus(); } }); return <MyInput ref={myInputRef} /> }