mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-08 17:33:15 +01:00
23 lines
No EOL
486 B
JavaScript
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'
|
|
}; |