Skip to content

Instantly share code, notes, and snippets.

@kazagkazag
Last active July 8, 2016 07:20
Show Gist options
  • Select an option

  • Save kazagkazag/f4829a62a613c12a150088e3f37905f0 to your computer and use it in GitHub Desktop.

Select an option

Save kazagkazag/f4829a62a613c12a150088e3f37905f0 to your computer and use it in GitHub Desktop.
class MyForm extends Component {
constructor() {
super();
this.state = {
value: "Hello!"
}
//bindings here
}
handleChange(event) {
this.setState({value: event.target.value});
}
render() {
return (
<form>
<input
type="text"
value={this.state.value}
onChange={this.handleChange}
/>
<textarea
name="description"
value="This is a description."
/>
<select value="B">
<option value="A">Apple</option>
<option value="B">Banana</option>
<option value="C">Cranberry</option>
</select>
</form>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment