когда я нажимаю кнопку отправки. не отображается Обязательная ошибка, поскольку это обязательное поле. вот мой код. Я уже зарегистрировался с обязательным и также пытался использовать правило, но все еще не получил требуемую проверку
<MuiPickersUtilsProvider utils={DateFnsUtils}>
<Controller
as={
<KeyboardDatePicker
autoOk
disableToolbar
variant="inline"
format="MM/dd/yyyy"
id={"appointmentDate"}
inputVariant="outlined"
inputRef={register({ required: true })}
label={"Appointment Date"}
required={true}
helperText={errors["appointmentDate"] && "Required..!!"}
error={errors["appointmentDate"] ? true : false}
KeyboardButtonProps={{
"aria-label": "change date"
}}
/>
}
rules={{ validate: value => value === null || "Required ..!!" }}
name={"appointmentDate"}
control={control}
/>
</MuiPickersUtilsProvider>
https://codesandbox.io/s/mui-autocomplete-with-react-hook-form-1p3x5