Skip to content

Missing props and incorrect types #766

@ChromeQ

Description

@ChromeQ

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-dropdown-picker@5.4.6 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions