Skip to content

Instantly share code, notes, and snippets.

@jkhaui
Last active December 28, 2018 22:22
Show Gist options
  • Save jkhaui/ea4379cac26ef3dacbc7794a10d6dba2 to your computer and use it in GitHub Desktop.
Save jkhaui/ea4379cac26ef3dacbc7794a10d6dba2 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import { Form } from 'semantic-ui-react';
class Filter extends Component {
constructor(props) {
super(props);
this.state = {
searchTerm: ''
}
this.updateSearchTerm = this.updateSearchTerm.bind(this);
}
onChange = (event) => {
this.setState({
value: event.target.value
});
}
render() {
console.log(this.state.searchTerm);
return(
<Form onSubmit={this.props.submitSearchTerm}>
<Form.Input
fluid
label="Search for a Title"
placeholder="Enter title"
value={this.state.searchTerm}
onChange={this.onChange}
/>
<Form.Button>
Submit
</Form.Button>
</Form>
)
}
}
export default Filter;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment