Skip to content

Instantly share code, notes, and snippets.

@viebel
Created June 19, 2017 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viebel/e2150d4a4bae8982c2cb546de9c36013 to your computer and use it in GitHub Desktop.
Save viebel/e2150d4a4bae8982c2cb546de9c36013 to your computer and use it in GitHub Desktop.
class TextInput extends React.Component {
constructor(props) {
super(props)
this.state = {value: ''}
this.handleChange = this.handleChange.bind(this)
}
handleChange(event) {
this.setState({value: event.target.value})
}
render() {
return (
<input type="text" value={this.state.value} onChange={this.handleChange} />
)
}
}
window.TextInput = TextInput
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment