0.2.7 • Published 2 years ago

react-native-mr-pullrefresh v0.2.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-native-mr-pullrefresh

NPM NPM MIT INSTALLED NODE STARS

  /\/\  _ __        / _ \_   _| | | /__\ ___ / _|_ __ ___  ___| |__
 /    \| '__|      / /_)/ | | | | |/ \/// _ \ |_| '__/ _ \/ __| '_ \
/ /\/\ \ |     _  / ___/| |_| | | / _  \  __/  _| | |  __/\__ \ | | |
\/    \/_|    (_) \/     \__,_|_|_\/ \_/\___|_| |_|  \___||___/_| |_|

react-native pull refresh on iOS, Android and Web

💪🏻 Support

Platformsolved
iOS🔥 Perfect
Android😂 Bottom response is bad
Web😭 Pulling and scrolling cant switch smoothly
Library
react-native-gesture-handler2.x
react-native-reanimated3.x

⚠️ Warning

react-native-mr-pullrefresh Only support wrapper Animated.ScrollView and Animated.FlatList

not support nested MrPullRefresh!

Installation

It relies on react-native-gesture-handler and react-native-reanimated

so please install them before you use this package

yarn install react-native-gesture-hanlder react-native-reanimated
yarn install react-native-mr-pullrefresh

Usage

import { MrPullRefresh } from 'react-native-mr-pullrefresh';

// ...

 <MrPullRefresh
  onPulldownRefresh={downLoader}
  onPullupRefresh={upLoader}
  pulldownHeight={80}
  pullupHeight={100}
  enablePullup
>

  <Animated.FlatList
    data={[]}
    renderItem={() => null}
  />

 {/* or*/}

  <Animated.ScrollView>
    {/* children */}
  </Animated.ScrollView>
</MrPullRefresh>

Example

iOSAndroid

Props

propstypedescriptionDefault
pulldownHeightNumberThe height of the drop-down load component is defined, and the judgment of the drop-down state depends on this value140
pullupHeightNumberThe height of the pull-up component is defined, and the pull-up state is determined by this value100
containerFactorNumberThe container factor is used to adjust the height of the refresh judgment0.5
pullingFactorNumberDetermine the coefficient of pulling state length2.2
enablePullupBooleanwhether show pullingupLoadingfalse
pulldownLoadingComponentYou can custom the Component
pullupLoadingComponentYou can custom the Component
onPulldownRefreshFunctioncallback of pulling down refresh, load data with it()=>void
onPullupRefreshFunctioncallback of pulling up refresh, load data with it()=>void

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

0.2.7

2 years ago

0.2.6

2 years ago

0.2.3

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago