Skip to content

Instantly share code, notes, and snippets.

@orYoffe
Created December 23, 2017 09:41
Show Gist options
  • Save orYoffe/10e4c5cad8788de31c21cfea6e9c76f1 to your computer and use it in GitHub Desktop.
Save orYoffe/10e4c5cad8788de31c21cfea6e9c76f1 to your computer and use it in GitHub Desktop.
React Native Web starter app NativePicker component
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