1 import React, {Component} from "react";
2 import PropTypes from "prop-types";
4 class SearchTermsInput extends Component {
5 constructor(props, context) {
7 this.handleAddTerm = this.handleAddTerm.bind(this);
8 this.handleChange = this.handleChange.bind(this);
11 handleAddTerm(event) {
12 event.preventDefault();
13 this.props.onAddTerm(event);
21 const terms = this.props.terms;
23 <div className="search-terms-input">
25 <button onClick={this.handleAddTerm}>Add term</button>
31 SearchTermsInput.propTypes = {
32 terms: PropTypes.arrayOf(PropTypes.element).isRequired,
33 onAddTerm: PropTypes.func.isRequired,
36 export default SearchTermsInput;