Created
February 16, 2019 15:14
-
-
Save Kornil/7b14960f2aa672d3fdd3a465b9d7d421 to your computer and use it in GitHub Desktop.
This file contains 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 characters
const Hello = () => { | |
const inputRef = useRef(null); | |
return ( | |
<input ref={inputRef} type='text' /> | |
<button onClick={() => inputRef.current.focus()}>click to focus the input</button> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment