Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@ouroboros/react-native-picker

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package version was removed
This package version has been unpublished, mostly likely due to security reasons

@ouroboros/react-native-picker

A replacement Picker for React-Native that relies on no other packages

unpublished
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
25
Maintainers
1
Weekly downloads
 
Created
Source

@oc/react-native-picker

Coming to the react-native party a bit late, I discovered that the standard Picker component no longer seems to exist, that it was removed from React-Native sometime at the end of 2021 in favour community packages which themselves started to break in 2022 due to no Picker being available. Since no alternative was presented, and I liked the look and feel of the iOS picker, I decided to attempt to recreate it using in pure react native components and offer it up to the community.

Installation

react-native

npm install @oc/react-native-picker

react-native expo

expo install @oc/react-native-picker

Getting Started

Import Picker from react-native-select-picker:

import Picker from '@oc/react-native-picker';

Create a state variable for the picker value:

let [picker, setPicker] = useState('CA');

Add the Picker to your component:

<Picker
	options={[
		{value: 'CA', text: 'Canada'},
		{value: 'MX', text: 'Mexico'},
		{value: 'US', text: 'United States'}
	]}
	onChanged={setPicker}
	style={{borderWidth: 1, borderColor: '#a7a7a7', borderRadius: 5, marginBottom: 5, padding: 5}}
	value={picker}
/>

Props

NameTypeRequiredDescription
onChangedFunctionYesA callback function which receives the new value selected by the user as the only argument
optionsObject[]YesArray of Objects with the value and text properties for each option to be shown
styleobject|object[]NoA single Obejct of styles values or an Array of styles objects to be passed to the input displayed in your component
textAlign['left', 'center', 'right']NoThe alignment of the text in the input
valuemixedYesThe current value selected in the Picker

Keywords

react-native

FAQs

Package last updated on 19 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts