Manage ASL magazines and their articles.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
asl-articles/web/src/SearchForm.js

34 lines
880 B

import React from "react" ;
import "./SearchForm.css" ;
// --------------------------------------------------------------------
export default class SearchForm extends React.Component
{
constructor( props ) {
super( props ) ;
this.state = {
queryString: "",
} ;
}
render() {
return (
<form id="search-form" onSubmit={this.onSearch.bind(this)}>
<label className="caption"> Search for: </label>
<input type="text" className="query"
value = {this.state.queryString}
onChange = { e => this.setState( { queryString: e.target.value } ) }
/>
<button type="submit"> Go </button>
</form>
) ;
}
onSearch( evt ) {
evt.preventDefault() ;
this.props.onSearch( this.state.queryString ) ;
}
}