-
Notifications
You must be signed in to change notification settings - Fork 16
/
index.js
35 lines (27 loc) · 819 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React,{
Component,
PropTypes
} from 'react';
import ReactNative,{
requireNativeComponent
} from 'react-native';
let NativeWheelView = requireNativeComponent('RCTWheelView',WheelView);
export default class WheelView extends React.Component{
static propTypes = {
onItemChange: PropTypes.func,
values: PropTypes.array,
isLoop: PropTypes.bool,
selectedIndex: PropTypes.number,
textSize: PropTypes.number,
itemsVisible: PropTypes.number,
velocityFling: PropTypes.number,
};
_onItemChange(event) {
if(this.props.onItemChange){
this.props.onItemChange(event.nativeEvent.index);
}
};
render(){
return <NativeWheelView {...this.props} onChange={this._onItemChange.bind(this)} />;
}
};