jsketcher/modules/ui/components/controls/InputControl.jsx
2018-01-19 01:25:26 -08:00

23 lines
No EOL
486 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import ls from './InputControl.less'
export default class InputControl extends React.Component {
render() {
let {type, inputRef, ...props} = this.props;
return <div className={ls[type]}>
<input type='text' ref={inputRef} {...props} spellCheck='false' />
</div>;
}
}
InputControl.propTypes = {
type: PropTypes.oneOf(['number', 'text']),
};
InputControl.defaultProps = {
type: 'text'
};