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

18 lines
437 B
JavaScript
Raw Normal View History

2016-10-28 04:51:37 +02:00
import React, { PropTypes } from 'react';
export default class StringControl extends React.Component {
handleChange = (e) => {
2016-10-28 04:51:37 +02:00
this.props.onChange(e.target.value);
};
render() {
return <input type="number" id={this.props.forID} value={this.props.value || ''} onChange={this.handleChange} />;
2016-10-28 04:51:37 +02:00
}
}
StringControl.propTypes = {
onChange: PropTypes.func.isRequired,
value: PropTypes.node,
forID: PropTypes.string,
2016-10-28 04:51:37 +02:00
};