[pickers] DateBuilderReturnType provides wrong type with no arg #13239
Labels
bug 🐛
Something doesn't work
component: pickers
This is the name of the generic UI component, not the React module!
typescript
Steps to reproduce
Add this test case to
test/utils/pickers/describeGregorianAdapter/testCalculations.ts
:Current behavior
adapter.date()
return type isDate | null
Expected behavior
adapter.date()
return type should be justDate
- same ifundefined
passed explicitlyadapter.date(undefined)
Context
This might be happening because of Distributive conditional types and has an easy fix in types
packages/x-date-pickers/src/models/adapters.ts
:Your environment
npx @mui/envinfo
Search keywords: DateBuilderReturnType mui-x-date-pickers
The text was updated successfully, but these errors were encountered: