static-cms/src/components/Widgets/StringControl.js

22 lines
460 B
JavaScript
Raw Normal View History

import React, { PropTypes } from 'react';
2016-05-30 16:55:32 -07:00
export default class StringControl extends React.Component {
constructor(props) {
super(props);
this.handleChange = this.handleChange.bind(this);
}
handleChange(e) {
this.props.onChange(e.target.value);
}
render() {
return <input value={this.props.value} onChange={this.handleChange}/>;
}
}
StringControl.propTypes = {
onChange: PropTypes.func.isRequired,
value: PropTypes.node,
};