Client feature #5

Merged
KevinMidboe merged 9 commits from client_feature into master 2017-06-03 09:19:01 +00:00
Showing only changes of commit 545152c888 - Show all commits

View File

@@ -0,0 +1,41 @@
import React from 'react';
class SearchRequest extends React.Component {
constructor(props){
super(props)
this.state = {
searchQuery: ''
}
}
_handleKeyPress(e) {
if (e.key === 'Enter') {
console.log('do validate');
}
}
handleChange(event){
this.setState({
searchQuery: event.target.value
})
console.log(this.state.searchQuery);
}
render(){
return(
<div>
<input
type="text"
onKeyPress={this._handleKeyPress}
onChange={this.handleChange.bind(this)}
defaultValue={this.state.searchItem}
/>
</div>
)
}
}
export default SearchRequest;