pull to refresh with flatlist
npm install react-native-djrefresh-librarypull to refresh with flatlist
iOS with MJRefresh
Android Native fork SwipeRefreshLayout

``sh`
npm install react-native-djrefresh-library
sh
cd ios & pod install
`
`js
import {
DJRefreshDefaultHeader,
DJRefreshHeader,
} from 'react-native-djrefresh-library';// ...
contentInsetAdjustmentBehavior="never"
automaticallyAdjustContentInsets={false}
style={styles.list}
data={DATA}
renderItem={({ item }) => }
keyExtractor={(item) => item.id}
refreshControl={
// default header
// // refreshing={refreshing}
// onRefresh={() => {
// console.log('开始刷新');
// setRefreshing(true);
// setTimeout(() => {
// console.log('结束刷新');
// setRefreshing(false);
// }, 3000);
// }}
// />
//custom header
refreshHeader={
style={{ width: '100%', height: 55 }}
source={require('./assets/animation_llq8e2yb.json')}
autoPlay
loop
/>
}
refreshing={refreshing}
onRefresh={() => {
console.log('开始刷新');
setRefreshing(true);
setTimeout(() => {
console.log('结束刷新');
setRefreshing(false);
}, 3000);
}}
/>
}
/>
``See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
---
Made with create-react-native-library