Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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' },
            ]}
        />
    );
};
Source by www.npmjs.com #
 
PREVIOUS NEXT
Tagged: #select #field #react #native
ADD COMMENT
Topic
Name
9+6 =