jsketcher/modules/ui/components/controls/InputControl.jsx
2020-03-09 23:46:16 -07:00

21 lines
No EOL
444 B
JavaScript

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