import DatePicker, { DatePickerProps, registerLocale } from "react-datepicker"; import { Control, Controller, FieldValues, Path, PathValue, } from "react-hook-form"; import { de } from "date-fns/locale"; registerLocale("de", de); interface DateInputProps extends Omit { control: Control; name: Path; } export const DateInput = ({ control, name, ...props }: DateInputProps) => { return ( ( field.onChange(date)} selected={field.value} {...(props as any)} /> )} /> ); };