1.0.0 • Published 6 years ago

react-native-picker-modal v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

react-native-picker-modal

A React Native Picker that mimics Android's implementation in iOS without changing the original API. It uses React Native's Picker on Android and Text that shows the Picker inside a Modal on iOS.

Install

npm i react-native-picker-modal --save
// OR
yarn add react-native-picker-modal

Usage

It receives and passes along the same props and children that the react-native Picker receives.

import PickerModal from 'react-native-picker-modal';
import { Picker } from 'react-native';

// ...

<PickerModal
  selectedValue={this.state.language}
  onValueChange={(itemValue, itemIndex) => this.setState({language: itemValue})}>
  <Picker.Item label="Java" value="java" />
  <Picker.Item label="JavaScript" value="js" />
</PickerModal>