
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-native-spin-picker
Advanced tools
A pure react native, spinner style select list with a simple interface.
This library is available on npm, install it with: npm i react-native-spin-picker or yarn add react-native-spin-picker.
render() {
return (
<SpinPicker
data={[...Array(100).keys()]}
value={this.state.selectedItem}
onValueChange={selectedItem => this.setState({selectedItem})}
keyExtractor={number => number.toString()}
renderItem={item => <Text>{item.toString()}</Text>}/>
);
}
import React from 'react';
import {SafeAreaView, Text, View} from 'react-native';
import {SpinPicker} from 'react-native-spin-picker'
interface AppState {
selectedItem: number
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#fff'
}
});
export default class App extends React.Component<{}, AppState> {
constructor(props) {
super(props);
this.state = {
selectedItem: 57
};
}
render() {
return (
<SafeAreaView style={styles.container}>
<View>
<SpinPicker
data={[...Array(100).keys()]}
value={this.state.selectedItem}
onValueChange={selectedItem => this.setState({selectedItem})}
keyExtractor={number => number.toString()}
showArrows
onInputValueChanged={this.onValueChanged}
renderItem={item => <Text>{item.toString()}</Text>}/>
</View>
</SafeAreaView>
);
}
private onValueChanged = (value: string, previousValue: string): string => {
const numberValue = Number(value);
if (!isNaN(numberValue) && numberValue < 100) {
this.setState({selectedItem: numberValue});
return value;
}
return previousValue;
};
}
| Name | Type | Default | Description |
|---|---|---|---|
| data | array | required | An array of any data to be presented |
| value | any | required | Value that is currently selected |
| onValueChange | function | required | Called whenever the selected item changed, should update value prop |
| renderItem | function | required | Renders list items, all items should be rendered with the same height (use fixed height if possible) |
| keyExtractor | function | required | Extracts a unique key from each data item, used for object comparison |
| showArrows | bool | false | Shows navigation arrows |
| onInputValueChanged | function | undefined (no text input) | Include to enable text entry, return value updates input (allows formatting or restrictions) |
| textInputProps | object | undefined | Input props applied to text input when enabled by onInputValueChanged (allows for input type, etc) |
| textInputStyle | object | undefined | Input style applied to text input when enabled by onInputValueChanged |
FAQs
A simple picker for React Native
We found that react-native-spin-picker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.