react-native-dropdown-picker icon indicating copy to clipboard operation
react-native-dropdown-picker copied to clipboard

Missing props and incorrect types

Open ChromeQ opened this issue 1 year ago • 0 comments

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

I noticed there are a few props not exposed to the main component and therefore cannot be used, and the onDirectionChanged actually has the wrong type. There may be others missing but these are the only 2 I used which I found to be missing.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-dropdown-picker/index.d.ts b/node_modules/react-native-dropdown-picker/index.d.ts
index 338c9de..e0cb98e 100644
--- a/node_modules/react-native-dropdown-picker/index.d.ts
+++ b/node_modules/react-native-dropdown-picker/index.d.ts
@@ -159,6 +159,7 @@ declare module 'react-native-dropdown-picker' {
     placeholder?: string;
     closeAfterSelecting?: boolean;
     labelProps?: TextProps;
+    itemLabelProps?: TextProps;
     disabled?: boolean;
     disabledStyle?: StyleProp<ViewStyle>;
     placeholderStyle?: StyleProp<TextStyle>;
@@ -261,7 +262,7 @@ declare module 'react-native-dropdown-picker' {
     onOpen?: () => void;
     onClose?: () => void;
     onChangeSearchText?: (text: string) => void;
-    onDirectionChanged?: (direction: DropDownDirectionType) => void;
+    onDirectionChanged?: (direction: 'top' | 'bottom') => void;
     zIndex?: number;
     zIndexInverse?: number;
     disableLocalSearch?: boolean;

This issue body was partially generated by patch-package.

ChromeQ avatar Oct 07 '24 23:10 ChromeQ