hossein-zare / react-native-dropdown-picker

A single / multiple, categorizable, customizable, localizable and searchable item picker (drop-down) component for react native which supports both Android & iOS.
https://hossein-zare.github.io/react-native-dropdown-picker-website/
MIT License
969 stars 294 forks source link

Add default/any option that reset single mode dropdown #708

Open asen23 opened 9 months ago

asen23 commented 9 months ago

Currently the only way to reset dropdown is by setting the value to null, but i'd like the option to add a "default/any" option that reset the dropdown by user picking it. While it is technically possible by creating a null value like this

{ label: 'Any', value: null }

While it is technically working in javascript, when using typescript the compiler complaint that null is not assignable to ValueType. So i'd like to propose a solution to allow null in ValueType or add a props that insert this default value and its label.