Skip to content

Commit 59a9bef

Browse files
[pickers] Fix regression on PickerValidDate (#14896)
1 parent e8991e9 commit 59a9bef

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePickerToolbar.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ const DateTimeRangePickerToolbarEnd = styled(DateTimePickerToolbar, {
112112
],
113113
}) as DateTimeRangePickerStartOrEndToolbarComponent;
114114

115+
type DateTimeRangePickerToolbarComponent = (<TDate extends PickerValidDate>(
116+
props: DateTimeRangePickerToolbarProps<TDate> & React.RefAttributes<HTMLDivElement>,
117+
) => React.JSX.Element) & { propTypes?: any };
118+
115119
const DateTimeRangePickerToolbar = React.forwardRef(function DateTimeRangePickerToolbar<
116120
TDate extends PickerValidDate,
117121
>(inProps: DateTimeRangePickerToolbarProps<TDate>, ref: React.Ref<HTMLDivElement>) {
@@ -236,7 +240,7 @@ const DateTimeRangePickerToolbar = React.forwardRef(function DateTimeRangePicker
236240
/>
237241
</DateTimeRangePickerToolbarRoot>
238242
);
239-
});
243+
}) as DateTimeRangePickerToolbarComponent;
240244

241245
DateTimeRangePickerToolbar.propTypes = {
242246
// ----------------------------- Warning --------------------------------

packages/x-date-pickers/src/models/pickers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export interface PickerChangeHandlerContext<TError> {
1111

1212
export interface PickerValidDateLookup {}
1313

14-
export type PickerValidDate = keyof PickerValidDateLookup extends number
14+
export type PickerValidDate = keyof PickerValidDateLookup extends never
1515
? any
1616
: PickerValidDateLookup[keyof PickerValidDateLookup];

0 commit comments

Comments
 (0)