import Input, { InputProps, InputRef } from 'antd/lib/input'; import React, { Ref } from 'react'; import { FieldProps, connectField, filterDOMProps } from 'uniforms'; import wrapField from './wrapField'; export type TextFieldProps = FieldProps< string, Omit, { inputRef?: Ref } >; function Text(props: TextFieldProps) { return wrapField( props, props.onChange(event.target.value)} placeholder={props.placeholder} readOnly={props.readOnly} ref={props.inputRef} type={props.type ?? 'text'} value={props.value ?? ''} {...filterDOMProps(props)} />, ); } export default connectField(Text, { kind: 'leaf' });