1
1
import React , { Component } from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
- import { ScrollView , View , StyleSheet , Platform , RefreshControl , ViewPropTypes } from 'react-native' ;
3
+ import { ScrollView , View , StyleSheet , Platform , RefreshControl } from 'react-native' ;
4
4
import { shallowEqual , swapArrayElements } from './utils' ;
5
5
import Row from './Row' ;
6
6
@@ -13,13 +13,17 @@ function uniqueRowKey(key) {
13
13
14
14
uniqueRowKey . id = 0
15
15
16
+ // react-native seems to sometimes represent stylesheet entries as numbers, and sometimes as objects.
17
+ // See: https://stackoverflow.com/questions/41483862/how-are-styles-mapped-to-numbers-in-react-native
18
+ const STYLE_TYPE = PropTypes . oneOfType ( [ PropTypes . number , PropTypes . object ] )
19
+
16
20
export default class SortableList extends Component {
17
21
static propTypes = {
18
22
data : PropTypes . oneOfType ( [ PropTypes . array , PropTypes . object ] ) . isRequired ,
19
23
order : PropTypes . arrayOf ( PropTypes . any ) ,
20
- style : ViewPropTypes . style ,
21
- contentContainerStyle : ViewPropTypes . style ,
22
- innerContainerStyle : ViewPropTypes . style ,
24
+ style : STYLE_TYPE ,
25
+ contentContainerStyle : STYLE_TYPE ,
26
+ innerContainerStyle : STYLE_TYPE ,
23
27
sortingEnabled : PropTypes . bool ,
24
28
scrollEnabled : PropTypes . bool ,
25
29
horizontal : PropTypes . bool ,
0 commit comments