Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

Get value from Picker onValueChange in react-native

$
0
0

I am developing an app using react native.Already I have implemented a list of user data. One example of data is this.

UID234 {"name":"Chris","age":31,"traits":{"eyes":"blue","shoe_size":10}}

Here's my code.


import RNPickerSelect from 'react-native-picker-select';...<RNPickerSelect     onValueChange={(value) => console.log(value)} // そのユーザーのvalueを取る     // {console.log(to_user)}    items={[      { label: 'Chris', value: 'UID234' },      { label: 'Marge', value: 'UID345' },      { label: 'Yuri', value: 'UID456' }            ]}     style={pickerSelectStyles}     placeholder={{ label: '選択してください', value: '' }}     />

In this case, when I select Chris, I can see "UID234" is shown on the console.

What I want to do is to print "Chris" on the screen.How can I do that? Please help me...


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>