import * as React from 'react' ; import { CommonProps } from './common-prop-types' ; type ControlProps = React . InputHTMLAttributes < HTMLInputElement > ; type ControlPropsCleaned = Omit < ControlProps , 'id' | 'name' > ; interface FileControlProps extends CommonProps , ControlPropsCleaned { elementRef : React . RefObject < HTMLInputElement > ; } type State = Record < string , unknown > ; class FileControl extends React . Component < FileControlProps , State > { public static defaultProps = { elementRef : React . createRef < HTMLInputElement > ( ) , } ; public render ( ) { const { elementRef , ... props } = this . props ; delete props . value ; return < input { ... props } type = "file" ref = { elementRef } / > ; } } export { FileControlProps } ; export default FileControl ;