picker
picker copied to clipboard
Expose PickerProps and PickerItemProps types
Feature request
Expose PickerProps and PickerItemProps types in the declaration files
Why it is needed
I'm trying to write a wrapper for this so it works similarly to how a select tag works in iOS (which is a good feature to add in itself IMO) and need to accept these props for that wrapper.
This is what I'm doing at the moment.
import { PickerProps } from 'node_modules/@react-native-community/picker/typings/Picker';
I was able to get the type using TypeScript's ConstructorParameters utility type which is a safer alternative.
import { Picker } from '@react-native-community/picker';
type PickerProps = ConstructorParameters<typeof Picker>[0];