Answers for "select field in react native"

1

select field in react native

// https://www.npmjs.com/package/react-native-picker-select
// npm install react-native-picker-select

//# React Native users
//npm install @react-native-picker/picker
//npx pod-install

//# Expo
//expo install @react-native-picker/picker
import RNPickerSelect from 'react-native-picker-select';

export const Dropdown = () => {
    return (
        <RNPickerSelect
            onValueChange={(value) => console.log(value)}
            items={[
                { label: 'Football', value: 'football' },
                { label: 'Baseball', value: 'baseball' },
                { label: 'Hockey', value: 'hockey' },
            ]}
        />
    );
};
Posted by: Guest on September-29-2021
0

react native select option

// use this package easy to use and more flexible 
https://www.npmjs.com/package/react-native-element-dropdown

 yarn add react-native-element-dropdown
Posted by: Guest on August-10-2021

Code answers related to "select field in react native"

Code answers related to "Javascript"

Browse Popular Code Answers by Language