xdriver
xdriver

Reputation: 1

After installing @mui/x-date-pickers, DatePicker's minDate maxDate type accepts only undefined

After doing the upgrade to have x-date-pickers in my project, the minDate={DATE} and maxDate={DATE} error saying :

Type 'Date | undefined' is not assignable to type 'undefined'.
  Type 'Date' is not assignable to type 'undefined'.ts(2322)
validation.d.ts(62, 5): The expected type comes from property 'maxDate' which is declared here on type 'IntrinsicAttributes & DatePickerProps<never, false> & RefAttributes<HTMLDivElement>'
(property) BaseDateValidationProps<never>.maxDate?: undefined
Maximal selectable date.

@default

2099-12-31

I've uninstalled and reinstalled the package, it's still weirdly saying it only accepts undefined instead of a Date like shown in the docs. What could be going wrong here?

Thanks !

Upvotes: 0

Views: 53

Answers (0)

Related Questions