Skip to content

Commit 865ef06

Browse files
authored
chore: type update (#708)
* chore: type update * chore: type update
1 parent 5e5bd80 commit 865ef06

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

src/PickerInput/RangePicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ function RangePicker<DateType extends object = any>(
741741
}
742742

743743
const RefRangePicker = React.forwardRef(RangePicker) as <DateType extends object = any>(
744-
props: RangePickerProps<DateType> & { ref?: React.Ref<PickerRef> },
744+
props: RangePickerProps<DateType> & React.RefAttributes<PickerRef>,
745745
) => React.ReactElement;
746746

747747
if (process.env.NODE_ENV !== 'production') {

src/PickerInput/SinglePicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ function Picker<DateType extends object = any>(
653653
}
654654

655655
const RefPicker = React.forwardRef(Picker) as <DateType extends object = any>(
656-
props: PickerProps<DateType> & { ref?: React.Ref<PickerRef> },
656+
props: PickerProps<DateType> & React.RefAttributes<PickerRef>,
657657
) => React.ReactElement;
658658

659659
if (process.env.NODE_ENV !== 'production') {

src/PickerPanel/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,5 +417,5 @@ if (process.env.NODE_ENV !== 'production') {
417417

418418
// Make support generic
419419
export default RefPanelPicker as <DateType extends object = any>(
420-
props: PickerPanelProps<DateType> & { ref?: React.Ref<PickerPanelRef> },
420+
props: PickerPanelProps<DateType> & React.RefAttributes<PickerPanelRef>,
421421
) => React.ReactElement;

tests/picker.spec.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,4 +1262,17 @@ describe('Picker.Basic', () => {
12621262
}),
12631263
);
12641264
});
1265+
1266+
it('classNames.popup', () => {
1267+
render(
1268+
<DayPicker
1269+
classNames={{
1270+
popup: 'bamboo',
1271+
}}
1272+
open
1273+
/>,
1274+
);
1275+
1276+
expect(document.querySelector('.rc-picker-dropdown')).toHaveClass('bamboo');
1277+
});
12651278
});

0 commit comments

Comments
 (0)