Skip to content

Commit 0cdb41e

Browse files
committed
updated version number and readme
1 parent 1eaaf1b commit 0cdb41e

File tree

4 files changed

+36
-37
lines changed

4 files changed

+36
-37
lines changed

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ For either platform, you can alternatively pass down a child element that will b
1717
### Installing
1818

1919
`npm install react-native-picker-select`
20-
or
21-
`yarn add react-native-picker-select`
2220

2321
### Usage
2422

@@ -40,14 +38,15 @@ or
4038
**Optional Props**
4139
* `placeholder` - object
4240
* An override for the default placeholder object with a label of `Select an item...` and a value of `null`
41+
* An empty object can be used if you'd like to disable the placeholder entirely
4342
* `hideDoneBar` - boolean
4443
* For the iOS component, hides the bar with tabbing arrows and Done link to exit the modal. While this is typical on `<select>` elements on the web, the [interface guidelines](https://developer.apple.com/ios/human-interface-guidelines/controls/pickers/) does not include it.
4544
* `hideIcon` - boolean
4645
* For the iOS component, hides the floating downward arrow on the right side of the input box
4746
* `disabled` - boolean
4847
* Disables interaction with the component
4948
* `value` - any
50-
* Will attempt to locate a matching value from the `items` array by checking each item's `value` key. If found, it will update the component to show that item as selected. If the value is not found, it will default to the placeholder.
49+
* Will attempt to locate a matching value from the `items` array by checking each item's `value` property. If found, it will update the component to show that item as selected. If the value is not found, it will default to the first item.
5150
* `style` - object
5251
* Style overrides for most parts of the component. More details below.
5352

example/example-headless.js

+19-17
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,37 @@ import {
66
} from 'react-native';
77
import RNPickerSelect from 'react-native-picker-select';
88

9-
import CustomButton from '.components/CustomButton'
9+
import CustomButton from '.components/CustomButton';
1010

1111
export default class App extends React.Component {
1212
constructor(props) {
1313
super(props);
1414

1515
this.state = {
1616
favColor: '',
17+
items: [
18+
{
19+
label: 'Red',
20+
value: 'red',
21+
},
22+
{
23+
label: 'Orange',
24+
value: 'orange',
25+
},
26+
{
27+
label: 'Blue',
28+
value: 'blue',
29+
},
30+
],
1731
};
1832
}
1933

2034
render() {
2135
return (
2236
<View style={styles.container}>
2337
<RNPickerSelect
24-
items={[
25-
{
26-
label: 'Red',
27-
value: 'red',
28-
},
29-
{
30-
label: 'Orange',
31-
value: 'orange',
32-
},
33-
{
34-
label: 'Blue',
35-
value: 'blue',
36-
},
37-
]}
38+
items={this.state.items}
39+
placeholder={{}}
3840
onSelect={
3941
(item) => {
4042
this.setState({
@@ -43,7 +45,7 @@ export default class App extends React.Component {
4345
}
4446
}
4547
>
46-
<CustomButton text="Select your favorite color"/>
48+
<CustomButton text="Select your favorite color" />
4749
</RNPickerSelect>
4850
</View>
4951
);
@@ -57,4 +59,4 @@ const styles = StyleSheet.create({
5759
justifyContent: 'center',
5860
paddingHorizontal: 10,
5961
},
60-
});
62+
});

example/example.js

+14-16
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,26 @@ import {
66
} from 'react-native';
77
import RNPickerSelect from 'react-native-picker-select';
88

9-
const items = [
10-
{
11-
label: 'Red',
12-
value: 'red',
13-
},
14-
{
15-
label: 'Orange',
16-
value: 'orange',
17-
},
18-
{
19-
label: 'Blue',
20-
value: 'blue',
21-
},
22-
];
23-
249
export default class App extends React.Component {
2510
constructor(props) {
2611
super(props);
2712

2813
this.state = {
2914
favColor: '',
30-
items,
15+
items: [
16+
{
17+
label: 'Red',
18+
value: 'red',
19+
},
20+
{
21+
label: 'Orange',
22+
value: 'orange',
23+
},
24+
{
25+
label: 'Blue',
26+
value: 'blue',
27+
},
28+
],
3129
};
3230
}
3331

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-picker-select",
3-
"version": "1.0.2",
3+
"version": "1.1.0",
44
"description": "A Picker component for React Native which emulates the native <select> interfaces for each platform",
55
"license": "MIT",
66
"author": "Michael Lefkowitz <[email protected]>",

0 commit comments

Comments
 (0)