Created
October 27, 2016 01:11
-
-
Save itsdouges/70168509b079a756eb96d7b61ad17be7 to your computer and use it in GitHub Desktop.
React Ref Callbacks Are Cool
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
// Make a textbox select itself when it is rendered. | |
const Textbox = () => ( | |
<div> | |
<input ref={(c) => c.select()} /> | |
</div> | |
); | |
// Neat ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment