wikimedica-disease-search/app/TermInput.js

33 lines
668 B
JavaScript

import React from 'react';
class TermInput extends React.Component
{
constructor(props)
{
super(props);
this.state = { input: '' };
this.handleInputChange = this.handleInputChange.bind(this);
}
handleInputChange(ev)
{
this.setState({
input: ev.target.value
});
}
render()
{
return (
<div className="TermInput">
<input type="text"
className="TermInput_input"
value={this.state.input}
onChange={this.handleInputChange} />
</div>
);
}
}
export default TermInput;