2016-06-16 19:20:36 -03:00
|
|
|
import React, { PropTypes } from 'react';
|
2016-05-30 16:55:32 -07:00
|
|
|
|
|
|
|
export default class StringControl extends React.Component {
|
2017-01-19 14:26:49 -02:00
|
|
|
handleChange = (e) => {
|
2016-05-30 16:55:32 -07:00
|
|
|
this.props.onChange(e.target.value);
|
2016-10-03 14:25:27 +02:00
|
|
|
};
|
2016-05-30 16:55:32 -07:00
|
|
|
|
|
|
|
render() {
|
2017-01-19 14:26:49 -02:00
|
|
|
return <input type="text" id={this.props.forID} value={this.props.value || ''} onChange={this.handleChange} />;
|
2016-05-30 16:55:32 -07:00
|
|
|
}
|
|
|
|
}
|
2016-06-16 19:20:36 -03:00
|
|
|
|
|
|
|
StringControl.propTypes = {
|
|
|
|
onChange: PropTypes.func.isRequired,
|
2017-06-04 17:20:40 +02:00
|
|
|
forID: PropTypes.string,
|
2016-06-16 19:20:36 -03:00
|
|
|
value: PropTypes.node,
|
|
|
|
};
|