DEV Community

Muhammad Bilal Mohib-ul-Nabi
Muhammad Bilal Mohib-ul-Nabi

Posted on

4 2

Using Drop Down Picker in React Native Expo Version 36 SDK

for expo use this works for me even is there a warn but works!

import { Picker } from 'react-native'
// state
 const [picked, setPicked] = useState(1.15);

 <Picker
        selectedValue={picked}
        style={{ height: 50, width: 100 }}
        onValueChange={(itemValue, itemIndex) =>
          setPicked(itemValue)
        }>

        <Picker.Item label="Canda 5%" value={1.05} />
        <Picker.Item label="Japan 8%" value={1.08} />

For Expo this will work.The React native picker suggested in their expo documentation was not working for me over version of 36 react native expo sdk.
import { Picker } from 'react-native' 
// state
 const [picked, setPicked] = useState(1.15);

 <Picker
        selectedValue={picked}
        style={{ height: 50, width: 100 }}
        onValueChange={(itemValue, itemIndex) =>
          setPicked(itemValue)
        }>

        <Picker.Item label="Canda 5%" value={1.05} />
        <Picker.Item label="Japan 8%" value={1.08} />
        <Picker.Item label="USA 10%" value={1.10} />
        <Picker.Item label="Egypt 14%" value={1.14} />
        <Picker.Item label="Saudi Arabia 15%" value={1.15} />
        <Picker.Item label="China 16%" value={1.16} />
        <Picker.Item label="Algeria 17%" value={1.17} />
        <Picker.Item label="18%" value={1.18} />
        <Picker.Item label="German 19%" value={1.19} />
        <Picker.Item label="German 19%" value={1.20} />
</Picker>
Enter fullscreen mode Exit fullscreen mode

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay