1// use this package easy to use and more flexible
2https://www.npmjs.com/package/react-native-element-dropdown
3
4 yarn add react-native-element-dropdown
5
1// https://www.npmjs.com/package/react-native-picker-select
2// npm install react-native-picker-select
3
4//# React Native users
5//npm install @react-native-picker/picker
6//npx pod-install
7
8//# Expo
9//expo install @react-native-picker/picker
10import RNPickerSelect from 'react-native-picker-select';
11
12export const Dropdown = () => {
13 return (
14 <RNPickerSelect
15 onValueChange={(value) => console.log(value)}
16 items={[
17 { label: 'Football', value: 'football' },
18 { label: 'Baseball', value: 'baseball' },
19 { label: 'Hockey', value: 'hockey' },
20 ]}
21 />
22 );
23};
24