mirror of
https://github.com/status-im/react-native.git
synced 2025-01-12 18:44:25 +00:00
[ReactNative] Expose ListView.DataSource instead of a top domain ListViewDataSource
This commit is contained in:
parent
39475de388
commit
a39024928e
@ -7,7 +7,6 @@
|
||||
var React = require('react-native');
|
||||
var {
|
||||
ListView,
|
||||
ListViewDataSource,
|
||||
ScrollView,
|
||||
ActivityIndicatorIOS,
|
||||
StyleSheet,
|
||||
@ -44,7 +43,7 @@ var SearchScreen = React.createClass({
|
||||
return {
|
||||
isLoading: false,
|
||||
isLoadingTail: false,
|
||||
dataSource: new ListViewDataSource({
|
||||
dataSource: new ListView.DataSource({
|
||||
rowHasChanged: (row1, row2) => row1 !== row2,
|
||||
}),
|
||||
filter: '',
|
||||
@ -192,7 +191,7 @@ var SearchScreen = React.createClass({
|
||||
});
|
||||
},
|
||||
|
||||
getDataSource: function(movies: Array<any>): ListViewDataSource {
|
||||
getDataSource: function(movies: Array<any>): ListView.DataSource {
|
||||
return this.state.dataSource.cloneWithRows(movies);
|
||||
},
|
||||
|
||||
|
@ -11,7 +11,6 @@ var {
|
||||
Image,
|
||||
LayoutAnimation,
|
||||
ListView,
|
||||
ListViewDataSource,
|
||||
StyleSheet,
|
||||
Text,
|
||||
TouchableOpacity,
|
||||
@ -72,7 +71,7 @@ var ListViewPagingExample = React.createClass({
|
||||
return dataBlob[rowID];
|
||||
};
|
||||
|
||||
var dataSource = new ListViewDataSource({
|
||||
var dataSource = new ListView.DataSource({
|
||||
getRowData: getRowData,
|
||||
getSectionHeaderData: getSectionData,
|
||||
rowHasChanged: (row1, row2) => row1 !== row2,
|
||||
|
@ -9,7 +9,6 @@ var React = require('react-native');
|
||||
var {
|
||||
Image,
|
||||
ListView,
|
||||
ListViewDataSource,
|
||||
TouchableHighlight,
|
||||
StyleSheet,
|
||||
Text,
|
||||
@ -25,7 +24,7 @@ var ListViewSimpleExample = React.createClass({
|
||||
},
|
||||
|
||||
getInitialState: function() {
|
||||
var ds = new ListViewDataSource({rowHasChanged: (r1, r2) => r1 !== r2});
|
||||
var ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
|
||||
return {
|
||||
dataSource: ds.cloneWithRows(this._genRows({})),
|
||||
};
|
||||
|
@ -77,6 +77,10 @@ var SCROLLVIEW_REF = 'listviewscroll';
|
||||
var ListView = React.createClass({
|
||||
mixins: [ScrollResponder.Mixin, TimerMixin],
|
||||
|
||||
statics: {
|
||||
DataSource: ListViewDataSource,
|
||||
},
|
||||
|
||||
/**
|
||||
* You must provide a renderRow function. If you omit any of the other render
|
||||
* functions, ListView will simply skip rendering them.
|
||||
|
Loading…
x
Reference in New Issue
Block a user