Created
December 6, 2016 09:08
-
-
Save davorbadrov/8bb4b8e3c142aa2fe5e0e227729f1166 to your computer and use it in GitHub Desktop.
React (controlled) form elements
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
// SELECT | |
<select value={this.state.value} onChange={this.handleChange}> | |
<option value="grapefruit">Grapefruit</option> | |
<option value="lime">Lime</option> | |
<option value="coconut">Coconut</option> | |
<option value="mango">Mango</option> | |
</select> | |
// TEXTAREA | |
<textarea value={this.state.value} onChange={this.handleChange} /> | |
// (TEXT) INPUT | |
<input type="text" value={this.state.value} onChange={this.handleChange} /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment