const renderInput = ({ input, label, meta }) => {
return (
<div className={`field ${meta.error && meta.touched ? 'error' : ''}`}>
<label>{label}</label>
<input type='text' {...input} autoComplete='off' />
</div>
);
};
<Field name='title' component={renderInput} label='Enter Title ' />
输入内容后,文本字段将失去焦点。
答案 0 :(得分:0)
added in **renderInput** function input attribute
<input
type='text'
{...input}
autoFocus={meta.active}
autoComplete='off'
placeholder={label}
/>
it is working...