@@ -21,7 +21,7 @@ export default class SortableList extends Component {
21
21
sortingEnabled : PropTypes . bool ,
22
22
scrollEnabled : PropTypes . bool ,
23
23
horizontal : PropTypes . bool ,
24
- refreshControl : PropTypes . object ,
24
+ refreshControl : PropTypes . element ,
25
25
26
26
renderRow : PropTypes . func . isRequired ,
27
27
@@ -149,21 +149,18 @@ export default class SortableList extends Component {
149
149
const { contentContainerStyle, horizontal, style : containerStyle } = this . props ;
150
150
const { contentHeight, contentWidth, scrollEnabled} = this . state ;
151
151
const innerContainerStyle = [ styles . container ] ;
152
- let refreshControl = this . props . refreshControl ;
152
+ let { refreshControl} = this . props ;
153
153
154
154
if ( horizontal ) {
155
155
innerContainerStyle . push ( { width : contentWidth } ) ;
156
156
} else {
157
157
innerContainerStyle . push ( { height : contentHeight } ) ;
158
158
}
159
159
160
- if ( refreshControl ) {
161
- refreshControl = (
162
- < RefreshControl
163
- { ...this . props . refreshControl . props }
164
- enabled = { scrollEnabled }
165
- />
166
- )
160
+ if ( refreshControl && refreshControl . type === RefreshControl ) {
161
+ refreshControl = React . cloneElement ( this . props . refreshControl , {
162
+ enabled : scrollEnabled , // fix for Android
163
+ } ) ;
167
164
}
168
165
169
166
return (
0 commit comments