Fix the getRowData method of SwipeableListViewDataSource in SwipeableListView

Summary:
This is simple fix to SwipeableListView. According to SwipeableListViewDataSource, the only method available is cloneWithRowsAndSections. If you try to get the data from a SwipeableListView, without this fix it won't work. This change fixes the problem so that SwipeableListView can work correctly.
Closes https://github.com/facebook/react-native/pull/8493

Differential Revision: D3523384

fbshipit-source-id: 359ff274fabcab676ed6dee24f0652c4146cde69
This commit is contained in:
Steven Scaffidi
2016-07-06 11:53:05 -07:00
committed by Facebook Github Bot 4
parent 3a24c63f73
commit ba3c7ef08c

View File

@@ -52,7 +52,7 @@ const SwipeableListView = React.createClass({
statics: {
getNewDataSource(): Object {
return new SwipeableListViewDataSource({
getRowData: (data, sectionID, rowID) => data[rowID],
getRowData: (data, sectionID, rowID) => data[sectionID][rowID],
getSectionHeaderData: (data, sectionID) => data[sectionID],
sectionHeaderHasChanged: (s1, s2) => s1 !== s2,
rowHasChanged: (row1, row2) => row1 !== row2,