@@ -11,27 +11,29 @@ import {
11
11
Text ,
12
12
ScrollView ,
13
13
TouchableOpacity ,
14
- Platform
14
+ Platform ,
15
+ ViewPropTypes
15
16
} from 'react-native' ;
16
17
17
18
import styles from './style' ;
18
19
import BaseComponent from './BaseComponent' ;
19
20
20
21
let componentIndex = 0 ;
22
+ let rnVersion = Number . parseFloat ( require ( 'react-native/package.json' ) . version ) ;
21
23
22
24
const propTypes = {
23
25
data : PropTypes . array ,
24
26
onChange : PropTypes . func ,
25
27
initValue : PropTypes . string ,
26
- style : View . propTypes . style ,
27
- selectStyle : View . propTypes . style ,
28
- optionStyle : View . propTypes . style ,
28
+ style : rnVersion >= 0.44 ? ViewPropTypes . style : View . propTypes . style ,
29
+ selectStyle : rnVersion >= 0.44 ? ViewPropTypes . style : View . propTypes . style ,
30
+ optionStyle : rnVersion >= 0.44 ? ViewPropTypes . style : View . propTypes . style ,
29
31
optionTextStyle : Text . propTypes . style ,
30
- sectionStyle : View . propTypes . style ,
32
+ sectionStyle : rnVersion >= 0.44 ? ViewPropTypes . style : View . propTypes . style ,
31
33
sectionTextStyle : Text . propTypes . style ,
32
- cancelStyle : View . propTypes . style ,
34
+ cancelStyle : rnVersion >= 0.44 ? ViewPropTypes . style : View . propTypes . style ,
33
35
cancelTextStyle : Text . propTypes . style ,
34
- overlayStyle : View . propTypes . style ,
36
+ overlayStyle : rnVersion >= 0.44 ? ViewPropTypes . style : View . propTypes . style ,
35
37
cancelText : PropTypes . string ,
36
38
keyboardShouldPersistTaps : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . bool ] )
37
39
} ;
0 commit comments