htmlFor在我的情况下不起作用,我想将htmlFor道具传递给Field任何想法??
我的组件内容字段reactStrap
<label htmlFor="cours">Cours</label>
<Field
className="mt-4"
name="cours"
component={ValidatedInput}
type="text"
validate={[required]}
/>
我的validateInput
export const ValidatedInput = props => {
const {
input,
type,
inputClassName,
disabled,
autoComplete,
meta: { touched, error }
} = props;
return (
<FormFields {...props}>
<Input
disabled={disabled}
{...input}
type={type}
autoComplete={autoComplete}
className={cs(inputClassName, { "is-invalid": touched && error })}
/>
</FormFields>
);
};