@@ -13,6 +13,7 @@ import {
13
13
Dimensions ,
14
14
View ,
15
15
Text ,
16
+ FlatList ,
16
17
TouchableWithoutFeedback ,
17
18
TouchableNativeFeedback ,
18
19
TouchableOpacity ,
@@ -21,7 +22,6 @@ import {
21
22
ActivityIndicator ,
22
23
} from 'react-native' ;
23
24
24
- import ListView from "deprecated-react-native-listview" ;
25
25
import PropTypes from 'prop-types' ;
26
26
27
27
const TOUCHABLE_ELEMENTS = [
@@ -283,9 +283,9 @@ export default class ModalDropdown extends Component {
283
283
_renderDropdown ( ) {
284
284
const { scrollEnabled, renderSeparator, showsVerticalScrollIndicator, keyboardShouldPersistTaps} = this . props ;
285
285
return (
286
- < ListView scrollEnabled = { scrollEnabled }
286
+ < FlatList scrollEnabled = { scrollEnabled }
287
287
style = { styles . list }
288
- dataSource = { this . _dataSource }
288
+ data = { this . props . options }
289
289
renderRow = { this . _renderRow }
290
290
renderSeparator = { renderSeparator || this . _renderSeparator }
291
291
automaticallyAdjustContentInsets = { false }
@@ -295,14 +295,6 @@ export default class ModalDropdown extends Component {
295
295
) ;
296
296
}
297
297
298
- get _dataSource ( ) {
299
- const { options} = this . props ;
300
- const ds = new ListView . DataSource ( {
301
- rowHasChanged : ( r1 , r2 ) => r1 !== r2
302
- } ) ;
303
- return ds . cloneWithRows ( options ) ;
304
- }
305
-
306
298
_renderRow = ( rowData , sectionID , rowID , highlightRow ) => {
307
299
const { renderRow, dropdownTextStyle, dropdownTextHighlightStyle, accessible} = this . props ;
308
300
const { selectedIndex} = this . state ;
0 commit comments