A pull to refresh ListView for React Native completely written in js. Also supports custom animations.
Installation
npm install react-native-refresher --save
Usage
var React = ;// Loading the refresher ListView and Indicatorvar RefresherListView LoadingBarIndicator = ; var AppRegistry Text View ListView = React; Component { super; thisds = r1 !== r2; thisstate = dataSource: thisds ; } { // You can either return a promise or a callback this; } { return <View style=flex:1> <RefresherListView dataSource=thisstatedataSource onRefresh=thisonRefresh indicator=<LoadingBarIndicator /> renderRow= <View style=padding:10borderBottomColor: '#CCCCCC' backgroundColor: 'white'borderBottomWidth: 1><Text>rowData</Text></View> /> </View> ; };
Examples
Props
threshold: number
The amount of pixeles to validate the refresh. By default the theshold will be calculated by the header height.minTime: number
The minimum amount of time for showing the loading indicator while is refreshing. Default 320ms.onRefresh: func.isRequired
Called when user pulls listview down to refresh.indicator: oneOfType([element])
React Element. See example of a custom indicatorrefreshOnRelease: bool
If is necessary to release touch for refresh or refresh will be done automatically once threshold is passed.listStyle: style
The list style
Credits
Refresher is created by Syrus Akbary and inspired by Refresher and react-native-refreshable-listview. If you have suggestions or bug reports, feel free to send pull request or create new issue.