Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 27, 2021. It is now read-only.

yusukeshib/react-pullrefresh

Repository files navigation

react-pullrefresh

Pull to reflesh material design component.
react-native is supported.

Demo

https://yusukeshibata.github.io/react-pullrefresh/

Install

npm install react-pullrefresh

Usage

import PullRefresh from 'react-pullrefresh'
class App extends Component {
 // onRefresh function canbe async/sync
 async onRefresh() {
 await someAsyncFunction()
 }
 // Without children PullRefresh element observe document.body's scroll
 render() {
 return (
 <PullRefresh
 onRefresh={::this.onRefresh}
 >
 {range(100).map(i => {
 return (
 <div key={i} className='row'>{i}</div>
 )
 })}
 </PullRefresh>
 )
 }
}
export default App

Behaviour difference between v1/v2

TODO:

Props

render

TODO:

color

default: #787878

bgColor

default: #ffffff

disabled

disable component

default: false

zIndex

specify css z-index.

default: undefined

onRefresh
async function onRefresh() {
 //...some async function
}
style

container style.

default: undefined

Removed props

  • size
  • offset
  • max
  • waitingComponent
  • pullingComponent
  • pulledComponent
  • supportDesktop

License

MIT

Packages

No packages published

Contributors 2

AltStyle によって変換されたページ (->オリジナル) /