From 4bd72056bfbb70f2b29de9b08eed1f1081f66816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Wed, 27 Dec 2023 10:51:56 +0800 Subject: [PATCH 1/2] chore: type update --- src/PickerInput/RangePicker.tsx | 2 +- src/PickerInput/SinglePicker.tsx | 2 +- src/PickerPanel/index.tsx | 2 +- tests/picker.spec.tsx | 13 +++++++++++++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/PickerInput/RangePicker.tsx b/src/PickerInput/RangePicker.tsx index a850a96cd..43d32233f 100644 --- a/src/PickerInput/RangePicker.tsx +++ b/src/PickerInput/RangePicker.tsx @@ -741,7 +741,7 @@ function RangePicker( } const RefRangePicker = React.forwardRef(RangePicker) as ( - props: RangePickerProps & { ref?: React.Ref }, + props: RangePickerProps & React.RefAttributes, ) => React.ReactElement; if (process.env.NODE_ENV !== 'production') { diff --git a/src/PickerInput/SinglePicker.tsx b/src/PickerInput/SinglePicker.tsx index a90f31ec8..ac05fc142 100644 --- a/src/PickerInput/SinglePicker.tsx +++ b/src/PickerInput/SinglePicker.tsx @@ -653,7 +653,7 @@ function Picker( } const RefPicker = React.forwardRef(Picker) as ( - props: PickerProps & { ref?: React.Ref }, + props: PickerProps & React.RefAttributes, ) => React.ReactElement; if (process.env.NODE_ENV !== 'production') { diff --git a/src/PickerPanel/index.tsx b/src/PickerPanel/index.tsx index abcb20582..eeed9c58f 100644 --- a/src/PickerPanel/index.tsx +++ b/src/PickerPanel/index.tsx @@ -417,5 +417,5 @@ if (process.env.NODE_ENV !== 'production') { // Make support generic export default RefPanelPicker as ( - props: PickerPanelProps & { ref?: React.Ref }, + props: PickerPanelProps & React.RefAttributes, ) => React.ReactElement; diff --git a/tests/picker.spec.tsx b/tests/picker.spec.tsx index 5469f04e9..f6a6bdadd 100644 --- a/tests/picker.spec.tsx +++ b/tests/picker.spec.tsx @@ -1262,4 +1262,17 @@ describe('Picker.Basic', () => { }), ); }); + + it('classNames.popup', () => { + render( + , + ); + + expect(document.querySelector('.rc-picker-dropdown')).toHaveClass('bamboo'); + }); }); From f1c74d4a9b17ada157d4b1014084aad771366089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Wed, 27 Dec 2023 11:00:23 +0800 Subject: [PATCH 2/2] chore: type update --- src/PickerPanel/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PickerPanel/index.tsx b/src/PickerPanel/index.tsx index eeed9c58f..ea067b06b 100644 --- a/src/PickerPanel/index.tsx +++ b/src/PickerPanel/index.tsx @@ -417,5 +417,5 @@ if (process.env.NODE_ENV !== 'production') { // Make support generic export default RefPanelPicker as ( - props: PickerPanelProps & React.RefAttributes, + props: PickerPanelProps & React.RefAttributes, ) => React.ReactElement;