import { h, Component } from 'preact' class TextInput extends Component { constructor(props){ super(props) this.handleInput = this.handleInput.bind(this) this.handleKeydown = this.handleKeydown.bind(this) } handleInput(e){ this.props.onInput && this.props.onInput(e.target.value) } handleKeydown(e){ if (e.keyCode === 13) { this.props.onSave && this.props.onSave(e.target.value) } } render() { return (