From 545152c888810e10bbfd0dd56b8755c05e327835 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Fri, 2 Jun 2017 14:35:43 +0200 Subject: [PATCH] Start of request, now just prints what is written in text field and reads keypress enter --- client/app/components/SearchRequest.jsx | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 client/app/components/SearchRequest.jsx diff --git a/client/app/components/SearchRequest.jsx b/client/app/components/SearchRequest.jsx new file mode 100644 index 0000000..acd680b --- /dev/null +++ b/client/app/components/SearchRequest.jsx @@ -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( +
+ + +
+ ) + } + + +} + +export default SearchRequest; \ No newline at end of file