Skip to content

Instantly share code, notes, and snippets.

@stelmakh
Last active December 19, 2018 18:13
Show Gist options
  • Select an option

  • Save stelmakh/02145aeba556b0a0a3daea27294f5e07 to your computer and use it in GitHub Desktop.

Select an option

Save stelmakh/02145aeba556b0a0a3daea27294f5e07 to your computer and use it in GitHub Desktop.
class Input extends React.Component {
onChange = (evt) => {
const { onChange } = this.props
const { value } = evt.target
if (onChange) {
onChange(value)
}
}
render() {
const {
value
} = this.props
return (
<input
value={value}
onChange={this.onChange}
/>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment