Pull to reflesh material design component.
react-native is supported.
https://yusukeshibata.github.io/react-pullrefresh/
npm install react-pullrefresh
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
TODO:
TODO:
default: #787878
default: #ffffff
disable component
default: false
specify css z-index.
default: undefined
async function onRefresh() {
//...some async function
}
container style.
default: undefined
- size
- offset
- max
- waitingComponent
- pullingComponent
- pulledComponent
- supportDesktop
MIT