Created
December 23, 2017 09:41
-
-
Save orYoffe/10e4c5cad8788de31c21cfea6e9c76f1 to your computer and use it in GitHub Desktop.
React Native Web starter app NativePicker component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { Picker } from 'react-native'; | |
export const NativePicker = ({ | |
style, | |
currentValue, | |
onChange, | |
options, | |
}) => ( | |
<Picker | |
style={style} | |
selectedValue={currentValue} | |
onValueChange={onChange} | |
> | |
{options.map(option => ( | |
<Picker.Item | |
key={`${option.label}_${option.value}`} | |
label={option.label} | |
value={option.value} | |
/> | |
))} | |
</Picker> | |
); | |
export default NativePicker; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment