Description
Basically SwipeableListView does not allow for custom parameters in the getNewDataSource Method.
I've made changes locally to allow for this but am inexperienced with pull requests and the such so I'd rather bring it here for discussion first.
Solution
static getNewDataSource(): Object {
return new SwipeableListViewDataSource({
getRowData: (data, sectionID, rowID) => data[sectionID][rowID],
getSectionHeaderData: (data, sectionID) => data[sectionID],
rowHasChanged: (row1, row2) => row1 !== row2,
sectionHeaderHasChanged: (s1, s2) => s1 !== s2,
});
}
And this is my local edit:
static getNewDataSource(params: ParamType): Object {
return new SwipeableListViewDataSource({
getRowData: (params.getRowData) ?
params.getRowData : (data, sectionID, rowID) => data[sectionID][rowID],
getSectionHeaderData: (params.getSectionHeaderData) ?
params.getSectionHeaderData : (data, sectionID) => data[sectionID],
rowHasChanged: (params.rowHasChanged) ?
params.rowHasChanged : (row1, row2) => row1 !== row2,
sectionHeaderHasChanged: (params.sectionHeaderHasChanged) ?
params.sectionHeaderHasChanged : (s1, s2) => s1 !== s2
});
}
Additional Information
- React Native version: 0.39.2
- Platform: Android
- Operating System: Windows
Description
Basically SwipeableListView does not allow for custom parameters in the getNewDataSource Method.
I've made changes locally to allow for this but am inexperienced with pull requests and the such so I'd rather bring it here for discussion first.
Solution
And this is my local edit:
Additional Information