diff --git a/Examples/Movies/SearchScreen.js b/Examples/Movies/SearchScreen.js index 2cd67aa19..2aa3f1ea8 100644 --- a/Examples/Movies/SearchScreen.js +++ b/Examples/Movies/SearchScreen.js @@ -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): ListViewDataSource { + getDataSource: function(movies: Array): ListView.DataSource { return this.state.dataSource.cloneWithRows(movies); }, diff --git a/Examples/UIExplorer/ListViewPagingExample.js b/Examples/UIExplorer/ListViewPagingExample.js index 4818da998..c74795eb5 100644 --- a/Examples/UIExplorer/ListViewPagingExample.js +++ b/Examples/UIExplorer/ListViewPagingExample.js @@ -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, diff --git a/Examples/UIExplorer/ListViewSimpleExample.js b/Examples/UIExplorer/ListViewSimpleExample.js index db6130843..c6b158f03 100644 --- a/Examples/UIExplorer/ListViewSimpleExample.js +++ b/Examples/UIExplorer/ListViewSimpleExample.js @@ -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({})), }; diff --git a/Libraries/Components/ListView/ListView.js b/Libraries/Components/ListView/ListView.js index 45539586b..086112724 100644 --- a/Libraries/Components/ListView/ListView.js +++ b/Libraries/Components/ListView/ListView.js @@ -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.